当前位置:Gxlcms > 数据库问题 > sql注意事项积累

sql注意事项积累

时间:2021-07-01 10:21:17 帮助过:22人阅读

1.一定要记住,SQL 对大小写不敏感

2.sql中的单引号 ‘‘,如果单引号中是字符串,代表是常量 如,select ‘b.phoneNumeber‘ from test; 如果是数字,如‘123‘,不需要,直接表示数字;如果是时间要加单引号‘20170206‘

 如:

mysql> select DISTINCT ‘LastName‘ , FirstName from Persons;
+----------+-----------+
| LastName | FirstName |
+----------+-----------+
| LastName | John      |
| LastName | George    |
| LastName | Carter    |
+----------+-----------+
3 rows in set (0.00 sec)

LastName就被当做一个常量给打印出来

sql注意事项积累

标签:car   --   sel   时间   select   mysq   art   phone   name   

人气教程排行