如何在SQL Server中使用where,groupby,orderby,having子句编写查询? [英] how to write a query with where,groupby,orderby,having clauses in sql server?

查看:135
本文介绍了如何在SQL Server中使用where,groupby,orderby,having子句编写查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在采访中面临的问题.

This is the question i faced in an interview.

can any one help?

推荐答案

有人可以帮助吗?"
是:使用数据库并尝试语句中的每个子句,您只会通过执行这些子句来了解它们. [
"Can anyone help?"
Yes: Use a database and try each of clauses in a statement, you''ll only learn about them by doing them. This[^] will give you pretty much all the information you''ll ever need, though you could google for the specific terms.


没有一种单一的方式可以编写这样的查询.实际上,根据需求,存在大量的可能性.看一下语法规范: http://msdn.microsoft.com/zh-cn/library/ms189499.aspx [^ ]

然后是一些示例: http://msdn.microsoft.com/en-us/library/ms187731.aspx [^ ]

并且最重要的是测试和探索不同的事物以便学习.一个很好的学习资源是: http://www.w3schools.com/sql/default.asp [ ^ ]
There''s no single way to write a query like that. Actually depending on the requirements there are enormous amount of possibilities. Have a look at the syntax specification: http://msdn.microsoft.com/en-us/library/ms189499.aspx[^]

Then some examples: http://msdn.microsoft.com/en-us/library/ms187731.aspx[^]

And most importantly test and explore different things in order to learn. One good resource in learning is: http://www.w3schools.com/sql/default.asp[^]


这篇关于如何在SQL Server中使用where,groupby,orderby,having子句编写查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆