|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
SQL query - possibly MAX?
I need an SQL query to return the highest hcs_sn value for a given hce_id.
hcs_sn hce_id 1 05121616 1 05271430 1 05277920 2 05277920 1 05294643 1 05296621 2 05296621 1 05306747 1 05317726 2 05317726 3 05317726 1 05330733 So my result should look like this: hcs_sn hce_id 1 05121616 1 05271430 2 05277920 1 05294643 2 05296621 1 05306747 3 05317726 1 05330733 However, the higest value can be any number (i.e. it may be greater than 3). It's been suggested that I may be able to use the MAX statement, but I'm having trouble doing this. I'd be grateful for any ideas. Thanks. |
|
#2
|
|||
|
|||
|
select max(hcs_sn), hce_id from tablename group by hce_id;
__________________
FSBO (For Sale By Owner) Realty |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > SQL query - possibly MAX? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|