-
rollba查看全部
-
begin使用事物查看全部
-
需要使用唯一序列號(hào)的場(chǎng)景查看全部
-
如何生成唯一序列號(hào)查看全部
-
行轉(zhuǎn)列的關(guān)鍵是union ,列轉(zhuǎn)行的關(guān)鍵是join查看全部
-
用序列表實(shí)現(xiàn) 贊??!查看全部
-
接上。。查看全部
-
union all實(shí)現(xiàn)查看全部
-
列轉(zhuǎn)行另一種場(chǎng)景查看全部
-
列轉(zhuǎn)行場(chǎng)景2查看全部
-
列轉(zhuǎn)行的場(chǎng)景查看全部
-
case方法實(shí)現(xiàn)行轉(zhuǎn)列查看全部
-
方法一 簡(jiǎn)單可以效率不高 修改也麻煩查看全部
-
關(guān)于學(xué)生成績(jī)的行轉(zhuǎn)列代碼參考: //表格定義及數(shù)據(jù) 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); //轉(zhuǎn)換代碼: 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;查看全部
-
刪除重復(fù)數(shù)據(jù)查看全部
舉報(bào)
0/150
提交
取消