473,419 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 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 1187
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

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

Similar topics

7
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
1
by: avinash | last post by:
hi my self avi i want to copy data from one table to other table,by giving certain condition and i want o use insert statement .in this i want to pass some value directly and some value from...
10
by: Antanas | last post by:
The problem is that when AddID is used multiple times in the same select statement, it returns the same value in all places. How could I force function AddID to increment OBJECTID sequence? Here...
0
by: Michael Seele | last post by:
hi! i need a list of all primary keys in my database! for this reson i build these sql-statement: /SELECT pg_class.relname AS tableName, pg_constraint.conname AS pkName, pg_constraint.conkey AS...
1
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
2
by: bhanab | last post by:
Hello, Please can someone help me with this select statement? How do I get the statement to keep the week number static? ie if there are no values then it should show up as NULL, zero or just stay...
3
by: =?Utf-8?B?TWlrZSBD?= | last post by:
I have a SQL 2000 table named IMSRejects with the fields: IMSRejects.ProductDescription IMSRejects.VendorName IMSRejects.CatalogNumber IMSRejects.ProductIMS2Desc IMSRejects.CMA8Desc Many of the...
1
by: anthonyjm | last post by:
I need to run a report for each record returned from a SQL Select statement. The report changes for each record, so they need to be run separately. So something like this (I have no idea what the...
1
by: themightyrhino | last post by:
I'm writing a process to perform multiple updates on a main table from information stored in different component reports. As you can see from the below, I'm using a select query to base the update...
0
by: DJN001 | last post by:
I need to perform a select statement that compares a literal to a timestamp.. like select * from table1 where timestampfld > 20100330
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.