
sql
happymff
从事测试10年+,在APP、Web、后端服务、机器人、蓝牙等方向有实际工作经验,并有5年+的管理经验~
展开
-
将4列的值显示成一列指定名字的表
将4列的值显示成一列指定名字的表select ( prefix||' ' ||first||' ' || last||' ' || suffix) as title from namesSELECTconcat_ws(' ', prefix,first,last,suffix)AS title FROMnames;原创 2017-10-28 17:22:19 · 241 阅读 · 0 评论 -
MySQL数据连接,关闭,还有设置数据库的编码方式
package UserManager; /** * Created by mff on 2017/5/15. */import java.sql.*;public class MysqlConnect { public static Connection connectMysql() { // 驱动程序名 // String driver = "原创 2017-10-31 14:45:37 · 304 阅读 · 0 评论 -
codewars--两张表连接查询的操作
题目:For this challenge you need to create a simple SELECT statement that will return all columns from the people table, and join to the sales table so that you can return the COUNT of all sales and R原创 2017-11-01 12:03:11 · 436 阅读 · 0 评论 -
连接查询
1.交叉连接查询返回两个或多个表所有数据行的笛卡儿积,没有where子句select* from store,stuff;2.内连接查询普通的连接类型,而且是最匀称的,添加where子句select 列名 from 表1,表2 where 表1.列名1=表2.列名2select 列名 from 表1 inner join 表2 on 表1.列名1=表2.列名2;sele原创 2017-11-01 12:41:43 · 266 阅读 · 0 评论 -
sql实现查询学习了所有课程的学生信息
select Sname from student where Sno IN (select Sno from SC group by Sno //根据Sno分组,统计每个学生选修了几门课程。如果等于course的总数,就是我们要找的Sno having count(*) = (select count(*) from course )) //统原创 2017-10-26 11:22:47 · 21323 阅读 · 1 评论