View previous topic :: View next topic
|
Author |
Message |
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Hi,
I have to append the string "DSNAME" for all the unique records in a field. The output should look like
---------+---------+
REQ_ID
---------+---------+
DSNAME 23407
DSNAME 185131
DSNAME 473890
DSNAME 536686
I used the query "SELECT 'DSNAME', DISTINCT REQ_ID FROM EXPLORE;
But I' am getting "DISTINCT IS NOT A COLUMN OF AN INSERTED TABLE" error.
My query is working if I remove "DISTINCT" keyword, but I' am getting duplicates. I want only the unique records. Can anyone help me?
Thanks,
Karthik. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
You can't do distinct on one column only it is on the whole selected column set.
Try this
Code: |
SELECT DISTINCT 'DSNAME', REQ_ID
FROM EXPLORE;
|
|
|
Back to top |
|
|
karthikbabudh
New User
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
|
|
|
|
Thanks a lot Steve.
Karthik |
|
Back to top |
|
|
|