Mysql点滴

  1. 统计函数的参数不能使用别名,如 sum(A+B)
  2. select 0 = 0000-00-00; //结果为1(true),也就是说全0的日期等价于0, php中也成立,且empty(0)为true
  3. select (@count:[email protected]+1) rowid from (select (@count:=0)) A; //其中A和:=都是必须的,否则会报错
  4. select * from (select * from table_name) A, table_name2 //在mysql查询时,只要其中一个表的子查询查询结果为空,则所有结果也为空
  5. 复制表(只复制结构,源表名:a 新表名:b) SQL: select * into b from a where 1<>1

相关文章:

  • 2021-07-20
  • 2022-02-15
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-06-03
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2022-01-10
  • 2021-06-30
  • 2021-09-15
相关资源
相似解决方案