472,107 Members | 1,221 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,107 software developers and data experts.

Perform a select statement to get lower values by id

15
Hi,

supposedly i have this table:
Expand|Select|Wrap|Line Numbers
  1. ID   Value
  2. 1     22
  3. 1     17
  4. 2     14
  5. 2     01
  6. 2     55
  7. 3     20
  8. 4     36
  9. 4     40
  10. 4     51
  11. 4     38
  12.  
and i want to select those records only:
Expand|Select|Wrap|Line Numbers
  1. ID   Value
  2. 1     17
  3. 2     01
  4. 3     20
  5. 4     36
  6.  
which means that i need the lowest values by id..

seems to be easy enough to accomplish, but i've gotten myself stuck on it...

thanks for any help
Aug 11 '10 #1
1 1150
ck9663
2,878 Expert 2GB
will a...

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT ID, MIN(Value) from YourTable Group by ID
  3.  
  4.  
work?

Happy Coding!!!

~~ CK
Aug 11 '10 #2

Post your reply

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

Similar topics

reply views Thread by Michael Seele | last post: by
1 post views Thread by serena.delossantos | last post: by
2 posts views Thread by bhanab | last post: by
3 posts views Thread by =?Utf-8?B?TWlrZSBD?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.