1.mysql建表語句
2.元資料查詢create table `user` (
`id` bigint (20) not null auto_increment comment '主鍵',
`username` varchar (50) not null comment '使用者名稱',
`password` varchar (50) not null comment '密碼',
primary key (`id`),
unique key `username` (`username`) comment '使用者名稱索引'
) engine = innodb default charset = utf8;
(1)查詢索引
(2)查詢資料庫表名show index
from
emp;
3.exists的使用-- 查詢資料庫中所有表名
select
table_name
from
information_schema. tables
where
table_schema = 'sql_learn'
4.mysql時區報錯解決select
d.deptno
from
dept d
where
exists (
select
null
from
emp e
where
d.deptno = e.deptno
);
show variables like '%time_zone%';
set global time_zone='+8:00';
C 實用記錄
一 工作中有時會用到的一些功能,記錄下來 遍歷資料夾下的檔案,輸入 資料夾路徑,返回檔名的vector void get image names const string file path,vector file names else while findnext hfile,fileinfo 0...
實用SQL語句
1 將乙個表中的內容拷貝到另外乙個表中 insert intotestt1 a1 b1,c1 selecta,b cfromtest insert intotesttselect fromtest 前提是兩個表的結構完全相同 insert intonotebook id title content ...
實用sql語句
1。加許可權 grant alter,create,select,insert,update,delete,index on recommend.to growth 10.1.1.1 identified by growth flush privileges alter table feed cha...