
mysql
明阳mark
这个作者很懒,什么都没留下…
展开
-
跨服务器复制表
select * into 本地库名..表名 from OPENDATASOURCE( 'SQLOLEDB ', 'Data Source=远程ip;User ID=sa;Password=密码 ' ).库名.dbo.表名 ...原创 2019-12-30 04:10:20 · 204 阅读 · 0 评论 -
mysql学习之二
分组函数 sum可以和district搭配使用 select sum(distinct salary), sum(salary) from employees; 其他分组函数也可以配合 查询有几种工资 select count(distinct salary), count(salary) from employees; ...原创 2019-11-13 01:28:33 · 81 阅读 · 0 评论 -
经典sql面试题
1、下面两句结果是否一样 select count(*) from employees; select count(*) from employees where commission_pct like '%%' and last_name like '%%'; 当有commission_pct 或者last_name 有为null就不同 ...原创 2019-11-10 23:37:18 · 98 阅读 · 0 评论 -
mysql学习
拼接字符串 select concat(first_name, last_name, '哈哈') from employees;原创 2019-11-09 01:10:10 · 124 阅读 · 0 评论 -
mysql50题及答案
网上流传较广的50道SQL训练,奋斗了不知道多久终于写完了。前18道题的难度依次递增,从19题开始的后半部分算是循环练习和额外function的附加练习,难度恢复到普通状态。 第9题非常难,我反正没有写出来,如果有写出来了的朋友还请赐教。 这50道里面自认为应该没有太多错误,而且尽可能使用了最简单或是最直接的查询,有多种不相上下解法的题目我也都列出了,但也欢迎一起学习的朋友进行讨论和解法优化啊~ ...原创 2019-11-07 14:03:50 · 1591 阅读 · 0 评论 -
重置mysql自增
设置从1开始 alter table piuto_custom_user_attribute auto_increment=2; truncate piuto_custom_user_attribute;原创 2019-05-29 10:42:33 · 121 阅读 · 0 评论 -
各种实用的sql语句
查找数据库里面所有表名 SELECT TABLE_NAME FROM information_schema.TABLES WHERE table_schema='pluto';原创 2019-06-24 14:52:50 · 110 阅读 · 0 评论 -
数据迁移
INSERT INTO data_air_district_hourly (timestamp, report_time, device_sn, data ) select timestamp, report_time, district_code, (('{"co":' || co || ',' || '"pm2_5":'...原创 2019-09-23 11:23:44 · 113 阅读 · 0 评论