Last post Oct 14, 2017 05:50 AM by sandeepmittal11
Oct 13, 2017 12:16 AM|Guhananth|LINK
I have an excel with column.
I want to select these rows by using IN CLAUSE in stored procedure. when i write IN CLAUSE IT IS NOT SELECTING CORRECT ADDRESSS.
I want to pass all address column in excel.
Table name ; A
select Address from A where Address in (select Address from split(@Address,',')this works fine if one address is passedselect Address from A where Address=@Address
1 31,Saptha street
2 34 . Nehru streee
3 35 gunsun street
Oct 13, 2017 02:57 AM|Deepak Panchal|LINK
can you show us what value you pass as an address?
try to pass the range which covers all the cells containing address.
you said that currently it is not selecting the correct address.
can you inform us what exactly happened?
which address it selects?
it is much helpful to us to understand the issue.
Oct 13, 2017 03:15 AM|Guhananth|LINK
select * from table where Address in (select Addr from split(@Address,','))
select * from table where Address in ('301,Appp Street,403 sStreeet,343tree ')
not finding exact address
Oct 13, 2017 09:51 AM|Deepak Panchal|LINK
I can see your query.
you pass all the address as one value. so it is not able to find.
you need to pass it like below.
you can notice in above query that each values are passed with in single quotes with semi colon to separate it.
Oct 14, 2017 05:50 AM|sandeepmittal11|LINK
Refer below post to understand more: