jackyji Posted May 31, 2006 Share Posted May 31, 2006 there is a table:code model remark1 a x2 a x3 a x4 b z5 b z6 c y7 c y8 c yi want to get the record of each model where the code is minimum.the result is:code model remark1 a x4 b z6 c yhow can i write the sql? Quote Link to comment https://forums.phpfreaks.com/topic/10812-i-want-to-get-the-record-of-each-model-where-the-code-is-minimum/ Share on other sites More sharing options...
hvle Posted May 31, 2006 Share Posted May 31, 2006 select code, model, remark from tablename group by model order by code; Quote Link to comment https://forums.phpfreaks.com/topic/10812-i-want-to-get-the-record-of-each-model-where-the-code-is-minimum/#findComment-40417 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.