当前分类:sql
thinkphp5开启sql日志记录

thinkphp5开启sql日志记录的方法

阅读全文

mysql报错Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column问题解决

报错信息:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'web_db.articles_tag.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

阅读全文

mysql报错Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column问题解决

报错信息:Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'web_db.articles_tag.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

阅读全文

mysql报错Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column问题

今天sql一对多关联查询发现一个错误,提示说查询的字段不在group by的子句中,因为sql_mode是only_full_group_by。

阅读全文

sql查询:存在A表而不在B表中的数据

A、B两表,找出ID字段中,存在A表,但是不存在B表的数据。方法一:使用 not in

阅读全文

sql update set使用case when语句

update TD_XXX set djyzmdm=null,djyzmsj=null,DLCS= case when DLCS is null then 1 else DLCS+1 end where djsj='xxx'

阅读全文

mysql表复制create table like和create table as比较

CREATE TABLE A LIKE B 此种方式在将表B复制到A时候会将表B完整的字段结构和索引复制到表A中来。

阅读全文

mysql 中find_in_set()和in()用法比较

mysql 中find_in_set()和in()用法比较,在mysql中in可以包括指定的数字,而find_in_set()用于特定的数据类型。find_in_set 函数使用方法个例子来说:有个文章表里面有个type字段,它存储的是文章类型,有 1头条、2推荐、3热点、4图文...1,12,13 等等 。

阅读全文

MySQL: ON DUPLICATE KEY UPDATE 用法

使用该语法可在插入记录的时候先判断记录是否存在,如果不存在则插入,否则更新,很方便,无需执行两条SQL

阅读全文

皖ICP备2023023451号

Copyright © L1MN.COM 联系方式:l1mnfw@163.com