To run a multi-line SQL query from the command line:
-
Type the first line of the query, then press Enter.
The ACT prompt changes from => to -> (for example, retail_sales->).
-
Enter the remaining lines.
You can press Ctrl-C at any time to abandon this command mode without executing the query.
- On the last line, type a semicolon at the end of the line, then press Enter to run the query.
For example:
retail_sales=> select customer_id, gender, city_id retail_sales->from customer_dim retail_sales->order by gender; or retail_sales=> select customer_id, gender, city_id retail_sales->from customer_dim retail_sales->order by gender retail_sales->;