一,在查询的结果集中使用别名的三种方式
1,使用as关键字来改变结果集中的别名
2,使用赋值运算符“=”来改变结果集中的别名,赋值的顺序是从右向左进行赋值的
例子 select 用户名=UserId, 付款方式=PayWay, 付款金额=PayMoney from OrderId; --把列UserId用用户名作为别名
3,使用空格来改变列的别名
二,查询NULL值
select * from UserInfo where Email is null
--如果原来有数据,而后又被删除,那么使用is null能否查询到?,答案查不到,使用下面语句可以查到
select * from UserInfo where Email is null or Email =‘‘
--is null 与 ‘’的区别
--is null:从未录入过数据,就没有地址
--‘’:录入过数据,而后被删除,原来是有地址的
原文:https://www.cnblogs.com/zhangxudong-cnblogs/p/10848151.html