Need help in SQL Server. My input comes from the UI, it comes as [Amazon, Kroger, Walmart]
when multiple elements are selected.
Now the value is passed to SQL Server and the table data should be filtered and send the data back to the API.
PFB for my table data:
I tried parsing the value which is coming from UI and replace the square brackets and apply the where clause, it's not working:
select Account, Channel
from GetMasterData
where Account in ((select '''' + REPLACE((select REPLACE(REPLACE('[Amazon,Kroger,Walmart]', '[', ''),']', '') as value), ',', ''',''')+'''' as value))
1条答案
按热度按时间z9ju0rcb1#
你可以试试这个。但是sql注入是可能的。