sql - Select SubQuery for Comma Separated Values from Single row -
from select query getting following values in single row , not in different rows:
id statuses --- ------------- 1 released,in progress,completed
now want write query should orders in statuses:
select * orders status in (select statusesfrom statustable)
adopt 1 of these splitters. can write own see lot has gone researching these:
http://www.sqlservercentral.com/articles/tally+table/72993/
this splits value table single column. can join on after run function on like:
select o.* orders o inner join splittable s on o.keycolumn = s.column
Comments
Post a Comment