随笔分类 - mysql技巧
1
记录mysql使用的小技巧
摘要:update v5_user set is_invite = 1 where id in ( select temp.to_uid from ( select to_uid from v5_invite_user where 1 ) temp )
阅读全文
摘要:DELETE FROM v5_shops WHERE id NOT IN ( SELECT t.id FROM ( SELECT MIN(id) AS id FROM v5_shops GROUP BY `shop_no` ) t )
阅读全文
摘要:sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
阅读全文
摘要:centos7.6安装 mysql8.0.31 https://blog.csdn.net/qq_45935297/article/details/129814514mysql学习手册 下载链接:https://downloads.mysql.com/archives/community/选择版本
阅读全文
摘要:SELECT b.id,b.uid,b.nickname,b.like,b.head,b.img,b.content,b.status, b.ranking FROM (SELECT t.*, @ranking := @ranking + 1 AS ranking FROM (SELECT @ran
阅读全文
摘要:建表 CREATE TABLE ts1 (a int, b int, index idx_a_b(a,b desc)); DELIMITER // CREATE PROCEDURE ts_insert() BEGIN DECLARE i INT DEFAULT 1; WHILE i < 800 DO
阅读全文
摘要:# 准备 #1. 准备表 create table s1( id int, name varchar(20), gender char(6), email varchar(50), first_name char(10), last_name char(10) ); #2. 创建存储过程,实现批量插
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <title>Simple Table</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/ja
阅读全文
摘要:<!DOCTYPE html><html lang="en"><head><title>Simple Table</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4
阅读全文
摘要:环境: CentOS Linux release 7.2.1511 (Core) mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64) using EditLine wrapper 1、首先进入主机的配置文件中 vim /etc/my.cnf log-
阅读全文
摘要:# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FIL
阅读全文
摘要:# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FIL
阅读全文
摘要:ALTER TABLE `80cms_column` ADD `c_typeimg` CHAR(160) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '栏目缩略图' AFTER `c_name`; ALTER TABLE `
阅读全文
摘要:UPDATE `ms_archives` SET title = REPLACE ( title, '月河湾', '蓝调国际' ); UPDATE `ms_archives` SET `keywords` = REPLACE ( title, '月河湾', '蓝调国际' ); UPDATE `ms_
阅读全文
摘要:mysql 开启远程连接指定的数据库 grant all privileges on `my_db`.* to 'username'@'%' identified by 'passwod' WITH GRANT OPTION; FLUSH PRIVILEGES; FLUSH PRIVILEGES;
阅读全文
摘要:UPDATE `yx_archives` SET `keywords` = REPLACE(`keywords`, '最', '');UPDATE `yx_archives` SET `title` = REPLACE(`title`, '最', '');UPDATE `yx_archives` S
阅读全文
摘要:SELECT group_concat(u.prize) AS prize, group_concat(u.code) AS code FROM `lc_unique` AS u INNER JOIN `lc_baoming` AS b ON u.webcookie = b.webcookie GROUP BY u.webcookie
阅读全文
摘要://获取昨天更新数据的条件date_sub(current_date(), interval 1 day) = from_unixtime(senddate, '%Y-%m-%d') 注释:date_subcurrent__date 获取当前日期 interval 1 day 减去1天 unixti
阅读全文
摘要:grant all privileges on huarenwang.* to 'huarenwang'@'%' IDENTIFIED BY 'huarenwang'; on后面的是指定的数据库to后面的是数据库用户名%是指定ip访问,如果是%数所有的ip都可以访问by后面的是数据库密码
阅读全文
摘要:时间存储格式是时间戳 SELECT * FROM 表名 WHERE 时间字段 BETWEEN UNIX_TIMESTAMP( CURDATE( ) ) AND UNIX_TIMESTAMP( NOW( ) )
阅读全文
1