Sql server, sql query, "IN" statement not working -
Sql server, sql query, "IN" statement not working -
this question has reply here:
creating sql table comma concatenated list 5 answersi have query comma seperated barcodes provided. unknown reason not working:
below code not work
declare @txtbarcode varchar(max) set @txtbarcode = '2003824,2003825'; select [scan_curr_location] barcode_location_current scan_curr_barcodeno in (@txtbarcode) order [scan_curr_barcodeno] asc however when alter single barcode works fine i.e:
set @txtbarcode = '2003824'; please advice.
thanks!
in not work that. takes comma separated list, not string comma separated values.
this work:
select [scan_curr_location] barcode_location_current scan_curr_barcodeno in ('2003824', '2003825') order [scan_curr_barcodeno] asc sql sql-server
Comments
Post a Comment