By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,410 Members | 1,626 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,410 IT Pros & Developers. It's quick & easy.

Get Distinct rows from multiple columns

Manikgisl
P: 37
I have a result ie.,
RecID Name ID1 ID2 ID3
1 OP014B_80460_013 1092 1743 1500
2 OP014B_80460_013 1743 1092 1500
3 OP014B_80461_001 1092 1774 1500
4 OP014B_80461_001 1774 1092 1500

From this i need to get result..
RecID Name ID1 ID2 ID3
2 OP014B_80460_013 1743 1092 1500
4 OP014B_80461_001 1774 1092 1500


Since 2 & 4 is the max intrecid

My query is
SELECT distinct(vchLotname) as Lot1,intAllottedTo, intReAllottedTo, intReAllottedBy FROM tbReAllottedLots WHERE
vchbatch='bt0809-11b' AND intPurposeID=1 ORDER BY vchLotName

How do i get the distinct from this

Thanks in Advance Happy new year...

Mani - Mani
Nov 19 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
When you say

Since 2 & 4 is the max intrecid
Do you mean max ID?

-- CK
Nov 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.