[firebird-support] RE: Possible to use FIRST 1 inside a group by?

2015-07-29 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Maya, Might not be the most efficient method, but this works: Unfortunately, it is least efficient method -- you will read each table row n^2 times Try: SELECT T.ID T.GroupID T2.FKCode T2.Value FROM ( select MIN (ID) as ID, GroupID from MyTable GROUP BY GroupID ) T

Rif: [firebird-support] RE: Possible to use FIRST 1 inside a group by?

2015-07-29 Thread 'Raffaele Confalone' r.confal...@libero.it [firebird-support]
-support] RE: Possible to use FIRST 1 inside a group by? Maya, Might not be the most efficient method, but this works: Unfortunately, it is least efficient method -- you will read each table row n^2 times Try: SELECT T.ID T.GroupID T2.FKCode T2.Value FROM ( select MIN (ID) as ID, GroupID

[firebird-support] RE: Possible to use FIRST 1 inside a group by?

2015-07-29 Thread Maya Opperman m...@omniaccounts.co.za [firebird-support]
I've got quite a tricky SQL query (well, at least for me it is, I'm hoping someone may have done this before) Here's a simplified example of what I'm trying to do: I have a table with IDGroupID FKCode Value 1 1