[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL - Group batch by lowest status

Posted on 2011-04-27
3
Medium Priority
?
185 Views
Last Modified: 2012-05-11
It's been a long day and I'm not getting my head around this at the moment.
I have a table with batch numbers and statuses. What I would like to do with SQL is get a result with one row for each batch with the lowest status. See the image below for what I'm getting at.
Does anyone have a suggestion on how I would set this SQL statement up?
Thanks,
Todd

SQL-Question.bmp
0
Comment
Question by:shambalad
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 2000 total points
ID: 35478991
Select batch, min(status) from table group by batch
0
 
LVL 7

Author Comment

by:shambalad
ID: 35479530
Perfect!
0
 
LVL 7

Author Closing Comment

by:shambalad
ID: 35479532
Thank you.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question