IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get DISTINCT on a single column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brganeshbabu

New User


Joined: 23 Jun 2005
Posts: 34
Location: Chennai

PostPosted: Mon Jul 02, 2007 8:11 pm
Reply with quote

I have a query which fetches around 10 fields. I am using DISTINCT in the query, even then I get duplicate rows as the DISTINCT is based on the whole record. Is it possible to use DISTINCT on a single column.

The query looks like....
SELECT DISTINCT FIELD1, FIELD2,FIELD3,FIELD4.... FIELD10 FROM
TABLE1,.... TABLE4 WHERE <SOME CONDITION>

The above query fetches many duplicate rows which has similar field values except for the FIELD10
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 09, 2007 6:28 am
Reply with quote

Hello,

If you will post some sample rows of data and how you want your query to work (the results from using those sample rows as input), we may be able to offer suggestoins.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top