P
Peter Jay Salzman
I'm learning SQL, and have two questions. The book I'm using has the
following SQL command:
SELECT tblClients.Organization, Trim([Firstname] & " " & [Lastname])
AS Contact, tblClients.WorkPhone, tblClients.State,
tblClients.LastContact FROM tblClients
WHERE (((tblClients.State)="IL")) ORDER BY tblClients.Organization;
There are a few things that I'm having trouble with.
1. If we identify records to select by both the field _and_ the table,
like "tblClients.Organization" and "tblClients.State", then why do
use the "FROM" clause to identify the table? It seems redundant
since we're already telling SQL which table to select the records
from.
2. I don't understand the book's explanation of what the AS keyword
does.
3. The clause
WHERE (((tblClients.State)="IL"))
looks like it has a redundant set of parentheses. What purpose does
the outer parentheses serve? To me, it looks like:
WHERE ((tblClients.State)="IL")
would be enough to group the expression for the WHERE clause.
Thanks!
Pete
following SQL command:
SELECT tblClients.Organization, Trim([Firstname] & " " & [Lastname])
AS Contact, tblClients.WorkPhone, tblClients.State,
tblClients.LastContact FROM tblClients
WHERE (((tblClients.State)="IL")) ORDER BY tblClients.Organization;
There are a few things that I'm having trouble with.
1. If we identify records to select by both the field _and_ the table,
like "tblClients.Organization" and "tblClients.State", then why do
use the "FROM" clause to identify the table? It seems redundant
since we're already telling SQL which table to select the records
from.
2. I don't understand the book's explanation of what the AS keyword
does.
3. The clause
WHERE (((tblClients.State)="IL"))
looks like it has a redundant set of parentheses. What purpose does
the outer parentheses serve? To me, it looks like:
WHERE ((tblClients.State)="IL")
would be enough to group the expression for the WHERE clause.
Thanks!
Pete