Help for SQL Query

Outline

The 'SQL Query' is the search function using the SQL. A SQLite DB table is created from the current workbook or a file and is searched. The search result can be pasted to a sheet. Or it can be loaded as a new sheet. Cell styles are not maintained in DB tables.

The following screen is shown, when the 'SQL Query' is selected from the menu of the cell/column/row/sheet or when the 'Load via SQL Query' is selected from the menu of the data file.

Creating DB Table

A DB table is created from the current workbook or a file by using 'create' and 'insert' statements of SQLite.

The creation from the current workbook is as follows.

  1. On first line, select 'Current Workbook'.
  2. On second line, specify the sheet number and range indicating the source data for a DB table. Appoint the range of all data using for SQL processing including search and display. You can appoint a cell range before calling SQL query.
  3. On third line, specify the creating table name, and touch the button 'Create'.
  4. At success, the result field shows 'Success'.

The creation from a file is as follows.

  1. On first line, select 'File'.
  2. On second line, pick up the file.
  3. On third line, specify the creating table name, and touch the button 'Create'.
  4. At success, the result field shows 'Success'.

The column names of the DB table are same as the column references of the source. And the column 'id' is added for the serial numbers. Except 'id', each item is stored as String.

When an existing DB table is specified, the DB table is overwritten. Plural DB tables can be made by changing the DB table name.

Searching Data

Data is searched with the 'select' statement of SQLite by the SQL statement configured from input fields.

select [Showing items] from [DB Table Names] [Conditions] limit [Showing limit]
  1. Specify the following fields.
  2. Touch the button 'Search'.
  3. At success, the result field shows the preview. Only the lead part of each item is shown.

Except the column 'id', each item is stored as String. To treat it as the Numeric type, convert it by the cast function such as 'cast(A as numeric)'.

Following are examples. Refer documents of SQL for details.

Using Result

  1. The search results are copied to the clipboard automatically.
  2. After returning to the main screen, long-touch a cell and choose 'Paste'. Too big data may be failed.
The clipboard text is the TSV (Tab Separated Values) form. It can be pasted in other applications.

In addition, the search result can be loaded to the main screen as a new sheet, if you choose "Load result" from the top-right 3-dots icon.

Removing DB Tables

The created DB tables are maintained until the delete instruction. The table of the same name is overwritten. To delete DB tables, show DB table list from the top-right 3-dots icon. All DB tables can be deleted from the top-right 3-dots icon of the list screen. Each DB table can be deleted by long-touching the DB table name in the list.