Groups | Blog | Home
all groups > sql server (alternate) > june 2003 >

sql server (alternate) : SQL Server Query (complicated)


murali_pinninti NO[at]SPAM hotmail.com
6/30/2003 7:16:35 AM
Folks,

I have the following data in a table:

4 NULL NULL
2 abc NULL
2 aaa NULL
4 xyz NULL
4 xyz pqr
4 pyz xqr

I want to get only one record for each record number. that is, the
result set should be like this:

4 NULL NULL
2 abc NULL

Please suggest how the query should be built. Thanks for the help.

Simon Hayes
6/30/2003 8:18:58 PM
Unfortunately, it's not easy to give a good answer without more information.
From what you have posted below, it's not clear why you want those two those
records and not one of the others, unless perhaps there is another column
which you didn't include and that you use to order by.

I suggest you post a CREATE TABLE for your table, with some INSERT
statements to add test data, and then a sample result set that you would
like to see.

Simon

[quoted text, click to view]

AddThis Social Bookmark Button