数据库 查询语句 放在VS2012 的什么地方
2个回答
推荐于2016-11-08 · 知道合伙人互联网行家
关注
展开全部
一个基本查询的逻辑过程:
(8) SELECT (9) DISTINCT (11) <TOP_specification> <select_list>
(1) FROM <left_table>
(3) <join_type> JOIN <right_table>
(2) ON <join_condition>
(4) WHERE <where_condition>
(5) GROUP BY <group_by_list>
(6) WITH {CUBE | ROLLUP}
(7) HAVING <having_condition>
(10) ORDER BY <order_by_list> --数字表示的是语句中部分的执行顺序。完全的结构语句如下列: SELECT DISTINCT top 5 * FROM table1
left JOIN table2 ON (table1.id=table2.id)
WHERE table1.id>10 GROUP BY table1.id HAVING table1.name like '张%'
ORDER BY name
(8) SELECT (9) DISTINCT (11) <TOP_specification> <select_list>
(1) FROM <left_table>
(3) <join_type> JOIN <right_table>
(2) ON <join_condition>
(4) WHERE <where_condition>
(5) GROUP BY <group_by_list>
(6) WITH {CUBE | ROLLUP}
(7) HAVING <having_condition>
(10) ORDER BY <order_by_list> --数字表示的是语句中部分的执行顺序。完全的结构语句如下列: SELECT DISTINCT top 5 * FROM table1
left JOIN table2 ON (table1.id=table2.id)
WHERE table1.id>10 GROUP BY table1.id HAVING table1.name like '张%'
ORDER BY name
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询