O'Reilly logo

Mastering PhoneGap Mobile Application Development by Kerri Shotts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Querying data (single table, joins, and so on)

Now that we have data in the database, we need to have a way to get that data back out. In SQL, this is done by using the SELECT statement. It's a very versatile command, so there's no way that it can be covered completely in a single chapter. Instead, we'll go over some simple commands, and you can explore the commands more on your own.

Note

The snippets in this section are located at snippets/08/ex5-select-data/ in the code package of this book. When using the interactive snippet playground, select 8: Web SQL Database and Example 5.

At its simplest, a SELECT statement looks as follows:

SELECT fieldName[, ...]
  FROM tableName[, ...]
[WHERE condition[ ...]]
[ORDER BY field [direction], ...]

Tip

There's a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required