SQL Control Bar

Check or uncheck View > Show/Hide > SQL to toggle the visibility of the SQL Control Bar.

Joining Tables

1. Adding one column to another table

At the SQL> prompt enter .mode add to set the output mode to add. Press Return.

At the SQL> prompt enter SELECT Oracle_CENSUSUK11DATA.POPY,OA2011_Greater_London.* FROM Oracle_CENSUSUK11DATA JOIN OA2011_Greater_London ON Oracle_CENSUSUK11DATA.OACODE = OA2011_Greater_London.OA11CD;

Press Return.

In this example the overlay Oracle_CENSUSUK11DATA column POPY are joined to the overlay OA2011_Greater_London table.

2. Adding multiple columns to another table

At the SQL> prompt enter .mode add to set the output mode to add. Press Return.

At the SQL> prompt enter SELECT OA2011_Greater_London.*,Oracle_CENSUSUK11DATA.POPY,Oracle_CENSUSUK11DATA.POPX FROM Oracle_CENSUSUK11DATA JOIN OA2011_Greater_London ON Oracle_CENSUSUK11DATA.OACODE = OA2011_Greater_London.OA11CD;

Press Return.

In this example the overlay Oracle_CENSUSUK11DATA columns POPX and POPY are joined to the overlay OA2011_Greater_London table.

3. Adding all columns to another table

At the SQL> prompt enter .mode add to set the output mode to add. Press Return.

At the SQL> prompt enter SELECT OA2011_Greater_London.*, Oracle_CENSUSUK11DATA.* FROM Oracle_CENSUSUK11DATA JOIN OA2011_Greater_London ON Oracle_CENSUSUK11DATA.OACODE = OA2011_Greater_London.OA11CD;

Press Return.

In this example all the columns in the overlay Oracle_CENSUSUK11DATA columns are joined to the overlay OA2011_Greater_London table.

See here for SQL examples.