I test FB4 Lateral join but it look as it work like INNER JOIN.
But i do not see a way to use LEFT JOIN.
You know, you have main table and you need for it e.g. last record from detail table, but if not exists still return record from main table.
Is there a way to do LEFT LATERAL? Or i still must use old stored procedure way?
regards,
Karol Bieniaszewski
I test FB4 Lateral join but it look as it work like INNER JOIN.
But i do not see a way to use LEFT JOIN.
Something like
SELECT R.RDB$RELATION_ID, R.RDB$RELATION_NAME, F.RDB$FIELD_NAME, F.RDB$FIELD_POSITION
FROM RDB$RELATIONS R LEFT JOIN
LATERAL (SELECT RF.RDB$FIELD_NAME, RF.RDB$FIELD_POSITION FROM RDB$RELATION_FIELDS RF
WHERE RF.RDB$RELATION_NAME = R.RDB$RELATION_NAME
AND RF.RDB$FIELD_POSITION > 2
ORDER BY RF.RDB$FIELD_POSITION DESC
ROWS 1) F
ON 1 = 1
It will show all relations and
- last field name and position, if there is more than 3 fields in relation, or
- nulls as field name and position
It is artificial, of course, but you see the syntax.
Regards.
Vlad
Thank you
Then i suppose firebird-40-language-reference.pdf should be updated
As it show example in syntax like.
RDB$RELATIONS R, LATERAL
And i have tried 😉 RDB$RELATIONS R, LEFT LATERAL
I have supposed that this is some special syntax.
But when i look at this now, it is simply old style join SQL 92 if i remember correctly?
Pozdrawiam,
Karol Bieniaszewski
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/e8f6b608-8759-4668-88aa-c0192c685975n%40googlegroups.com.
Hi Mark
You know, one example is better then 1000 of words. No one look for syntax definition at first strep only at example.
First example should show basic usage, this is working example, but should show something more natural.
Current example as you can see can be misleading in some way.
Regards,
Karol Bieniaszewski
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/6cbdd08311442df39af0e63744292a1b%40lawinegevaar.nl.
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/a293f968e6f1f4554112a36fb27cc20b%40lawinegevaar.nl.
A little off topic, but where can i find markup description?
Regards,
Karol Bieniaszewski
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/6d43b711a221eb9c34255a2471e480bc%40lawinegevaar.nl.