After reading about the new Firebird 2.1 alpha I was eager to test it, and
here are some sample queries that show how the new features look like, all examples are based
on the standard EMPLOYEE.FDB.
The first one is about the MERGE statement, which is useful in many ways (my
favourite is synching tables).
- MERGE
- INTO country c
- USING (
- SELECT * FROM country
- UNION ALL
- SELECT 'Maroc' country, 'Dirham' currency FROM rdb$database
- ) cd
- ON (c.country = cd.country)
- WHEN MATCHED THEN
- UPDATE SET
- country = …