And there is a reason to have Distinct, There is just a bug in DB2 Imagine there are two values like 5 , 5 , both of those will be choosen, but for a DISTINCT select, it should only take out one of those lines, unfortunately DB2 cannot handle that and will give a DISTINCT select with two equal...
Was it that unclear? I found how to do it anyway:
Select a, b, c from 2, ( select a, max(2.TIME) AS MAX from 1 , 2, where 1.a = 2.a and 1.TIME > "2008" GROUP by a) AS X where X.a = a and X.max = time;
I want to get some data, from 2 fields, but I don't want to select distinctly by them
In my tables I have
Table 1:
A B TIME
Table 2:
A B C D E TIME
my select is
select distinct a, max(2.TIME) from 1 , 2, where 1.a = 2.a and 1.TIME > "2008" GROUP by a
The problem I have is I want to get...
It shouldn't be hard to do, I hope.
What I want to do is this:
select table1.id from table1,table2 where table1.id != table2.id .... I wish it was possible to write like that... but it doesn't I guess I can figure out the reason but anyway how should I do it? PLEAse help... example...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.