-
rollba查看全部
-
begin使用事物查看全部
-
需要使用唯一序列號的場景查看全部
-
如何生成唯一序列號查看全部
-
行轉列的關鍵是union ,列轉行的關鍵是join查看全部
-
用序列表實現 贊!!查看全部
-
接上。。查看全部
-
union all實現查看全部
-
列轉行另一種場景查看全部
-
列轉行場景2查看全部
-
列轉行的場景查看全部
-
case方法實現行轉列查看全部
-
方法一 簡單可以效率不高 修改也麻煩查看全部
-
關于學生成績的行轉列代碼參考: //表格定義及數據 create table if not exists score( id smallint unsigned not null primary key auto_increment, uname varchar(100) not null, subject varchar(100) not null, score smallint not null )engine=innodb default charset=utf8; insert score values (default, 'a', 'math', 10), (default, 'a', 'english', 20), (default, 'a', 'chinese', 30), (default, 'b', 'math', 50), (default, 'b', 'english', 60), (default, 'b', 'chinese', 70), (default, 'c', 'math', 110), (default, 'c', 'english', 120), (default, 'c', 'chinese', 130); //轉換代碼: select math.uname,math.math,english.english,chinese.chinese from (select id, uname, score as math from score where subject='math') as math inner join (select id, uname, score as english from score where subject='english') as english on math.uname=english.uname inner join (select id, uname, score as chinese from score where subject='chinese') as chinese on chinese.uname=english.uname;查看全部
-
刪除重復數據查看全部
舉報
0/150
提交
取消