July 26, 2006 at 8:15 am
Hi All,
Gotta a problem.
I have a table with the following data ( Column names are G1 / G2 / G3 / G4)
B E B A
B E B B
B E B D
B E B F
B E C A
B E C A
B E C B
B E C D
B E C F
B E F A
I want to return only the rows where all 4 values are different.
Can't seem to make this happen, anyone have a suggestion ?
Dave
July 26, 2006 at 8:47 am
Hi Dave,
Try this:
Hope that helps,
July 27, 2006 at 5:15 pm
Hi Dave, perhaps you mean just the unique rows, in that case try
select g1,g2,g3,g4 from mytable group by g1,g2,g3,g4 having count(*)=1;July 28, 2006 at 6:45 am
SELECT DISTINCT G1,G2,G3,G4
FROM
WHERE (G1 <> G2 AND G1 <> G3 AND G1 <> G4)
AND (G2 <> G3 AND G2 <> G4)
AND (G3 <> G4)
Far away is close at hand in the images of elsewhere.
Anon.
July 31, 2006 at 4:21 am
Hi, All
Just wanted to thank everyone for their help.
All the Best
Dave
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply