-
Suggest debugging in Menu
Tools
SQL
, if you are not already doing this.
-
Suggest quoting identifiers. While this is not always necessary, it serves to clarify distinctions from reserved words at times. ("", `` or [] in Embedded HSQLDB 1.8). (Back tick quote in MariaDB or MySQL).
-
If it doesn’t work, break it down until it does, e.g. try,
SELECT zip As xx
FROM families INNER JOIN participants ON families.familyid=participants.familyid;
or even simplify to
SELECT zip As xx FROM families;
Until it works, then build it back together one step at a time, testing as you go. Use a text editor in another window to keep your code so you can cut and paste to go backwards and forwards in your construction.
Here is a working HSQLDB example for you:
In this database: Lookup3.odb
SELECT "Name" As "N", "Product" As "P"
FROM "Companies" INNER JOIN "Products"
ON "Companies"."Company ID"="Products"."Company ID"
ORDER BY "Name";
This also works in this case:
SELECT Name As N, Product As P
FROM Companies INNER JOIN Products ON Companies.[Company ID]=Products.[Company ID]
ORDER BY Name;
Returns status:
Command successfully executed.
And outputs:
Big Dog Products,Bark collar,Big Dog Products,
IBM,pc,IBM,
IBM,IBM 370,IBM,
Intel,8086,Intel,
Intel,8080,Intel,
Main Street Tools,screw driver,Main Street Tools,
Main Street Tools,wrench,Main Street Tools,
Rayco,diode, vaccume tube,Rayco,
Toyota,takoma,Toyota,
Toyota,echo,Toyota,