Hello
I'm having some doubts to build a query (if it possible)...
I have this table,
idReg (PK + AutoInc), FieldFK, InternalNumber,Name,Qt
----------------------------------------------------------------------
1 | 8 | 1111 | Prod1 | 123.3
2 | 7 | 2222 | Prod2 | 222.2
3 | 8 | 111A | Prod1Renamed | 100
4 | 2 | 4444 | Pord9 | 12
5 | 7 | 3333 | Prod2 | 333
What i want from this table it's all the rows with Distinct FieldFK, with the idReg MAX...
The query result would be (not necessarly by this order):
3 | 8 | 111A | Prod1Renamed | 100
4 | 2 | 4444 | Pord9 | 12
5 | 7 | 3333 | Prod2 | 333
I'm trying to build the query, but i don't get anywhere...
Distinct only works if i only select the FieldFK if i had the other fields i get all the rows because it have distinct values for the other columns. What i need it's a kind of max for each FieldFK.




Rate People That Helped You
Reply With Quote