hidrau
asked on
Return a row from query where keys are different from other rows in the same table
Hello guys
I have a table with some rows, I need to make a query where only the row that is diferent from must be return in my query
something like this the x.codprod='A1258'
select * from table01 a
inner join table01 b on (b.xname<>a.xname and b.xcoddep<>a.xcoddep and b.xcodprod<>a.xcodprod)
it should return me
How to do that?
thanks
I have a table with some rows, I need to make a query where only the row that is diferent from must be return in my query
something like this the x.codprod='A1258'
select * from table01 a
inner join table01 b on (b.xname<>a.xname and b.xcoddep<>a.xcoddep and b.xcodprod<>a.xcodprod)
it should return me
create table table01 (
xname varchar(20),
xcoddep varchar(20),
xcodprod varchar(20)
)
insert into table01 (xname, xcoddep, xcodprod) values ('alexandre', '01452', 'A1257')
insert into table01 (xname, xcoddep, xcodprod) values ('alexandre', '01452', 'A1257')
insert into table01 (xname, xcoddep, xcodprod) values ('alexandre', '01452', 'A1257')
insert into table01 (xname, xcoddep, xcodprod) values ('alexandre', '01451', 'A1258')
select * from table01
How to do that?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER