Formulating SQL QueriesEven if You Know Nothing About Databases


A query picks out certain types or groups of data within a database for use in your document (or for any purpose, for that matter). This saves you the trouble of manually looking through all the records to find just what you want. Use the wizard to help set up SQL queries in OOo. Here's how it's done.

Click the Windows tab and select your Base file.

Click the Queries icon in the Database pane at the left. In the Tasks pane, select Use Wizard to Create Query.

The main Base query screen.

In the field selection screen, choose the desired table from the Tables dropdown menu. Choose your fields by selecting a field and then clicking the right arrow to move the field to the Fields in the Query window. Click Next.

The field selection screen.

Choose the sort order in step 2. Pick a field from the Sort by dropdown menu. Secondary fields are sorted using the Then by dropdown menu. Click Next.

The sorting order screen.

In step 3 you can conditionally select which fields will be displayed. For instance, if you want to show records with a field that is a certain value, you could query for the value here.

Steps 4 through 7 deal with more selection options. In our example, click Next to get to the Overview step.

The search conditions screen.

Use the overview screen to name your query, and then click Finish. The query runs and produces the results in a regular spreadsheet-style screen.

The query produces the results.

An SQL query whittles data into manageable chunks. Switch back to the Writer document via the Window tab. The query results appear when you click the + next to the Query icon. The database itself is visible via the View button and the Datasources menu item.

The next step is to create a printable report.




Point & Click OpenOffice. org.
Point & Click OpenOffice.org
ISBN: 0131879928
EAN: 2147483647
Year: 2003
Pages: 143
Authors: Robin Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net