1.从数据库A中把表tableA导入到数据库B中 --如果主键是自增,则必须列出具体字段.-- select * into tableA from A..tableA 2.批量更改表中某列中的某个字符串 update table[表名] set Fields[字段名]=replace(Fields[字段名],'被替换原内容','要替换成的内容') 3.把数据库中某张表数据生成插入语句 )) as begin ) ) set @sql =' (' set @sqlValues = 'values…
Mysql 常用 SQL 语句集锦 基础篇 //查询时间,友好提示 $sql = "select date_format(create_time, '%Y-%m-%d') as day from table_name"; //int 时间戳类型 $sql = "select from_unixtime(create_time, '%Y-%m-%d') as day from table_name"; //一个sql返回多个总数 $sql = "select…
Mysql 常用 SQL 语句集锦 基础篇 //查询时间,友好提示 $sql = "select date_format(create_time, '%Y-%m-%d') as day from table_name"; //int 时间戳类型 $sql = "select from_unixtime(create_time, '%Y-%m-%d') as day from table_name"; //一个sql返回多个总数 $sql = "select…
一.DCL语句(数据控制语句) 1.授权远程访问,针对IP和用户.DB的 grant {privilege list} on {dbname}.* to '{user}'@'{ip}' identified by '{pwd}' with grant option ex: grant all privilege on *.* to 'root'@'%' identified by '***' with grant option; -- %代表所有IP grant all privileges o…
花点时间整理下sql基础,温故而知新.文章的demo来自oracle自带的dept,emp,salgrade三张表.解锁scott用户,使用scott用户登录就可以看到自带的表. #使用oracle用户登录linux [oracle@localhost ~]$ sqlplus / as sysdba; ...... SQL> alter user scott account unlock: 四大语句 DQL语句--select DML语句--insert,upate,delete等(关键…