这是java交流群里一个网友面试的时候发过来的笔试题,我觉得题目的假定条件应该是某个字母对应的最小数字只有一个. 思路第一步是查出一个子表s1: select name,min(number) from USERS group by name.当然这后面可以加having count(name)>1;我的解法是选择不加,意思就是就算一个字母对应一个数字,也把他给取出来放进这个子表中. 第二步就比较麻烦,怎么删除多余的元素呢?如果 用 delete from USERS where name i
SELECT CONCAT('SELECT COUNT(*) FROM ',table_name,' union all') FROM information_schema.tables WHERE table_name LIKE 'tbl_sms_bill_1806%' INTO OUTFILE '/tmp/full06.sql'; SELECT CONCAT('SELECT COUNT(*) FROM ',table_name,' union') FROM information_schem
1.全表查询 SELECT * FROM `wh_statistics_service_api_request`; 由于上面时间是按year,month,day三个数值字段来存时间的,现在想通过时间段查询,可以用concat将三个字段拼接 SELECT CONCAT(t1.year,'-',t1.month,'-',t1.day) as accessDate, t1.total_request_count as accessCount FROM wh_statistics_service_api
SELECT school_code,`name`,phone from student WHERE login_name REGEXP 'ning$'LIMIT 10; concat() SELECT CONCAT(school_code,`name`) from student WHERE login_name REGEXP 'ning$' LIMIT 10; SELECT CONCAT(school_code,`name`,phone) from student WHERE logi
Mysql 1. Mysql基础知识 1.1. Index and table searching of Mysql 1.1.1. Basic concepts of Mysql and DBMS 1.What is sql: a storage for storing data and sql means Structured Query language 2.Contents of sql : title and table 3.DB: database是指长期存储在