The SQL command for querying data in a database is very powerfull and therefore can be quite complex. To adres sthat problem I provide here a small step by step tutorial how to build a SELECT command. May be it is easier for you to answer the following questions and to build so your custom SELECT command step by step:
Syntax:
CREATE DATABASE dbname
[ IN dbspace ]
[ { WITH [ LOCATION = 'dbpath' ] [ TEMPLATE = template ] [ ENCODING = encoding ] }
| { WITH [ BUFFERED ] LOG }
| { WITH LOG MODE ANSI } ]
Description:
Creates a new database in the database management system. Attention, the syntax and the options vary from database system to database system.
Syntax
INSERT INTO Tablename
[ ( Fieldname [,...] ]
{ VALUES ( Valueliste
[,...] ) } | SELECT-Command
;
Description:
-- english, deutsch, russian --
Syntax
SELECT * |
{ [
DISTINCT |
ALL ]
{ fieldlname |
CASE-command [ [AS] Alias ] } [,...] }
FROM { Tablename
[ Alias ] } [,...]
[ WHERE logical construct ]
[ GROUP BY { Fieldname |
Integer } [,...] ]
[ HAVING logical construct ]
[ { UNION | INTERSECT |
EXCEPT [ALL] SELECT-Command } ]
[...]
[ ORDER BY { Fieldname |
Integer [ ASC|DESC ] } [,...] ]
[ INTO { TEMP | SCRATCH } Tablename ]
;
Description:
The author has written this SQL-help in his free time because a quick and permanently online SQL-tutorial was needed. This is only a part of the whole SQL-standart, for more information about its implementations on different database systems please contact the software manyfacturers. The "Standard-SQL", first developed by IBM, was improved by software firms that develop relational database management systems (RDBMS). But all of this improvements can not be discussed in an brief help file. The small table after the command/keyword indicates in some cases, in wich system this command/keyword is implemented.