0

Let's say this is your database:

   A    B           C 
  157  szept-01   3000 
  157  okt-01     -312

I tried this: (ofc, i get a not a group by warning, because C isn't grouped by) But i would like to get the value of C in my query, how could i solve it?

    Select A, MIN(B), C
    FROM DB
    GROUP BY A;

When i use this (I get every value of C for every B, but i ONLY want value C for the minimal B)

    Select A, MIN(B), C
    FROM DB
    GROUP BY A, C;

This is my purpose:

    A    B          C
   157  szept-01   3000

EDIT: I dont see it duplicate, the other is not solved perfectly imho. (There are tons of updates, and i dont see the exact answer)

  • 1
    Just replace max with min in the duplicate topic. – Shadow Oct 02 '17 at 10:27
  • The accepted answer in that indicated thread offers two different solutions which produce the same (desired) result. Have you tried applying either approach to your situation? – APC Oct 02 '17 at 10:57

0 Answers0