Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tneken
Starting Member
4 Posts |
Posted - 2009-06-22 : 09:18:02
|
| Hi.I need help to create a query. I need to get the fastest processingtime for each program on each machine.The table look like thismachine_id program process_timeA 1 20A 1 22B 1 40B 1 38A 2 24A 2 25A 1 23B 2 45The result i need should look like this.A 1 20A 2 24B 1 38B 2 45 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-22 : 09:24:34
|
| select machine_id, program, min(process_time) as process_time from your_tablegroup by machine_id, programMadhivananFailing to plan is Planning to fail |
 |
|
|
tneken
Starting Member
4 Posts |
Posted - 2009-06-22 : 10:03:19
|
| Thank you. It was just what i needed |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-22 : 10:19:56
|
quote: Originally posted by tneken Thank you. It was just what i needed
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|