sql2000 + distinct rows
-
i have a query in sql2000 if i want to select distinct scid,requirement,comments from table1 i am not getting distinct rows . distinct keyword is not working .can you please give me some clue.it is urgent.
My guess is that the DISTINCT keyword is working but that your rows aren't - well - distinct.
--------------------------- Blogging about SQL, Technology and many other things
-
My guess is that the DISTINCT keyword is working but that your rows aren't - well - distinct.
--------------------------- Blogging about SQL, Technology and many other things
-
Yes, that is how DISTINCT works. The entire selected row must be identical to others for them to be filtered away.
--------------------------- Blogging about SQL, Technology and many other things
-
Distinct runs on every column after it unless you put the column list in parenthesis () like SELECT Distinct(col1), col2,col3 you can also group columns in the distinct clause or combine them if they are character strings like SELECT Distinct (Col1 + Col2), col3 distinct will only operate on the column specified, but in your syntax you are accidently specifying all of the columns, and i imagine that you dont have 2 rows where all 3 columns contain the same data. Oh before i forget, Sql Server 2000's query analyzer tool has the absolute best help under help -> tranact SQL help. it is very well written and has fairly good examples, i use it all the time.
-
i have a query in sql2000 if i want to select distinct scid,requirement,comments from table1 i am not getting distinct rows . distinct keyword is not working .can you please give me some clue.it is urgent.
Do you have text or ntext columns in this table? because as I remember,
distinct
won't work fine with them.Hesham A. Amin My blog