可以在下列场合中使用:
1. VALUES clause of INSERT statements
2. The SELECT list of a SELECT statement
3. The SET clause of an UPDATE statement
而不能在下列场合使用:
■ A subquery
■ A view query or materialized view query
■ A SELECT statement with the DISTINCT operator
■ A SELECT statement with a GROUP BY or ORDER BY clause
■ A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator
■ The WHERE clause of a SELECT statement
■ DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement
■ The condition of a CHECK constraint
更多详细内容请参阅:
http://chenzs19850728.blog.163.com/blog/static/762960920083710532829/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-1004085/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10599713/viewspace-1004085/
本文介绍了SQL在不同场景下的正确使用方式,包括INSERT语句的VALUES子句、SELECT语句的选择列表以及UPDATE语句的SET子句等。同时,也指出了SQL不适用的情况,例如子查询、带有DISTINCT操作符的SELECT语句等。
3158

被折叠的 条评论
为什么被折叠?



