[firebird-support] Is it true that old alter index ... inactive scripts are invalid for Firebird 3.0?

2019-08-08 Thread jonatan.laurit...@yahoo.dk [firebird-support]
Hi! Sometimes I need to deactive all indices (for some special processing whose intermediate results can invalidate constraints) and then reactive them all again. Of course, I can do this with DB restore option which does not activate indices during restore process. But so far I have always

[firebird-support] Re: SELECT FIRST N BY GROUP

2019-08-08 Thread pg...@mccolls.co.uk [firebird-support]
Thanks Dimitri, unfortunately we are using FB 2.5

Re: [firebird-support] SELECT FIRST N BY GROUP

2019-08-08 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
ROW_NUMBER, as Dimitry suggests, is available from Firebird 3. The following query should work regardless of Firebird version: SELECT s.* FROM SALARIES s LEFT JOIN SALARIES s2 on s.EMPID = s2.EMPID and s.EFFDATE < s2.EFFDATE LEFT JOIN SALARIES s3 on s2.EMPID = s3.EMPID and s2.EFFDATE < s3.EFFDATE