Let’s say I have the following,
declare @A table (a int)
insert into @A
select 1 union all
select 2 union all
select 3
select a FROM @A
where a > ALL (select 1 union all select 2)
This will work. But I need to use Like instead of greater than here,
declare @A table (a int)
insert into @A
select 1 union all
select 2 union all
select 3
select a FROM @A
where a LIKE ALL (select 1 union all select 2)
Please help me.
Edit:
Here is the my original old table look like,
declare @A table (a varchar(500))
insert into @A
select 'a;b;c' union all
select 'a;d;b' union all
select 'c;a;e'
My application is sending values in my SP as ‘a;b’ or ‘b;c;a’ etc,
Now I need to Select only those Rows in table @A which have a and b or b and c and a.
I am using split function in my SP to make user input as table.
That’s why I need to use Like ALL here. But any other suggestion is also welcome.
It is not possible to use all with like. If I understand you correctly you could use something like this instead.
Result