SQL语句

虽然 SELECT 语句的完整语法较复杂,但是其主要的子句可归纳如下:

  SELECT select_list
  [ INTO new_table ]
  FROM table_source
  [ WHERE search_condition ]
  [ GROUP BY group_by_expression ]
  [ HAVING search_condition ]
  [ ORDER BY order_expression [ ASC | DESC ] ]
  可以在查询之间使用 UNION 运算符,以将查询的结果组合成单个结果集。
 
也就是说,order by放在最后面。
我实践过的那些sql语句
 
access: SELECT * FROM (select * from AllStudent where quyu like "*绍兴*") where id >4000;
asp:"select zhiye,count(zhiye) as total from Allstudent group by zhiye"
asp: sql="select count(id) as total from Allstudent  where datediff('yyyy',birthday,now)>="&startAge&" and datediff('yyyy',birthday,now)<"&endAge
posted @ 2013-08-28 08:58  cls404508644  阅读(225)  评论(0编辑  收藏  举报