1. Process date data
Select * from subject where pubtime >=# 01/01/2005 #
2. "*" is used in access to replace "%" in standard SQL ".
3. "_" represents a single character
Select * from users where name like '__'
4. The having clause allows you to specify conditions for each group, following the group by clause.
Select username, count (*)ArticleQuantity
From subject
Group by username
Having username in ('admin', 'flyer ')
5. calculate mathematical expressions
Select 5 + 6*10 + 10.5/23-(35-3)/90 as result
6. For the parameter SQL Server, use "@ parameter name", while oledb uses "?", When adding parameters to the oledbcommand object, the order must be the same as that defined in the SQL command.
Strsql = "select count (*) from orderclient where clientid =? ";
7. case statement
select au_fname, au_lname,
case state
when 'CA' then 'california '
when 'K' then 'Kansas'
when 'tn 'then' Tennessee '
When 'or 'then' Oregon'
when 'mi 'then' Michigan '
When' in 'then' Indiana '
when 'md 'then' maryland '
when 'ut' then 'utah'
end as statename
from pubs. DBO. authors
order by au_lname