Odd, I get a different result with these 2 queries.
select distinct i.number, eot.sequence, eot.anotherfield, eot.description
/*select distinct count(*) as "Number of rows without EOT"*/
from
inst i,
inst_player ip,
ownership o,
electronic_output_title eot
where i.number = ip.number
and ip.number = o.number (+)
and o.sequence = eot.sequence (+)
and i.inst_number = '28'
and eot.myfield is null
if I change from one of the selected to an other I get 2 different results, the one that I'm using now returns 6000 some values, the other returns a number in the 15000.
MyTable
MyField1, Myfield2
1 B
1 C
1 D
2 A
2 A
2 C
select distinct count(*) from #MyTable
RETURNS 6 (the result set only has one row - the number field - and it's "distinct" among the result set)
select distinct MyField1 from #MyTable
RETURNS 2 rows (1, 2) since those are the unique occurances of the fields selected
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.