Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> sql query wanted
Hi,
This seems to much for me ...
I have
create table foobar (id varchar(10), sku varchar(10));
insert into foobar values ('1', 'a'); insert into foobar values ('2', 'b'); insert into foobar values ('3', 'a'); insert into foobar values ('3', 'b'); insert into foobar values ('4', 'c'); insert into foobar values ('5', 'a'); insert into foobar values ('5', 'c'); insert into foobar values ('6', 'a'); insert into foobar values ('6', 'b'); insert into foobar values ('7', 'a'); insert into foobar values ('7', 'b'); insert into foobar values ('7', 'c');
Now I have to query based on sku: I need all id's where there are row's for that id with exactly the sku's provided.
Example:
if I have a it should return 1 if I have b it should return 2 if I have c it should return 4
Any advice?
Thanks
Christian
Received on Thu Feb 21 2002 - 11:15:23 CST