Not part of aggregate function

gmworrall

Registered User.
Local time
Today, 22:48
Joined
Jun 19, 2012
Messages
18
I've tried using the search but besides it not being possible the 'easy' way, I can't find anything specific to my function. I *think* it'll be some sort of subquery, but I'm only just getting used to writing SQL by hand so still need a little guidance...

I need the minimum cost, grouped by PID. But I also need SID to pull through - but I can't include it without using GROUP BY, which doesn't bring the required result.

Sample
---
PID SID Cost
1 1 9
1 2 8
2 3 9
2 4 10

Result wanted
---
PID SID Cost
1 2 8
2 3 9

Thanks in advance!
 
pbaldy, sorry forgot to reply!

Thanks for the link. Managed to get it doing what I wanted. :)
 

Users who are viewing this thread

Back
Top Bottom