Hi,
I have a table with irecordid, tipartytype, and snamelast. With the following data:
irecordid, tiPartyType, sNameLast
12345 1 EASTON
12345 1 WHS 1A LLC
12345 1 WHS 2B LLC
12345 1 WHS 2C LLC
12345 1 WHS 2D LLC
12345 2 WELLS FARGO BANK
I am trying to find the min(snamelast) for each tipartytype in a record.
I have tried:
But, I still get all 6 rows of data. I don't just get the min(snamelast) value for each tirecordtype.
Is there a way to adjust my script to do this?
Using SQL 2000.
Thanks!
Brian
I have a table with irecordid, tipartytype, and snamelast. With the following data:
irecordid, tiPartyType, sNameLast
12345 1 EASTON
12345 1 WHS 1A LLC
12345 1 WHS 2B LLC
12345 1 WHS 2C LLC
12345 1 WHS 2D LLC
12345 2 WELLS FARGO BANK
I am trying to find the min(snamelast) for each tipartytype in a record.
I have tried:
Code:
select irecordid, tipartytype, min(snamelast) from mytable
where irecordid = 12345
group by irecordid, tipartytype, snamelast
But, I still get all 6 rows of data. I don't just get the min(snamelast) value for each tirecordtype.
Is there a way to adjust my script to do this?
Using SQL 2000.
Thanks!
Brian