次の構造のテーブルがあり、特定のalbum_id
&のすべての時間の合計を取得したいと思いdisc
ます。私はこのhttp://board.phpbuilder.com/showthread.php?10326769-RESOLVED-time-helpを見つけました、そしてそれは幾分良さそうに見えました(最初の答えのコードの最初の断片)、しかし私はそれを動かす方法を理解することができませんi番目のmysql..。
テーブル構造:
CREATE TABLE IF NOT EXISTS `tracks` (
`id` int(255) NOT NULL AUTO_INCREMENT,
`artist_id` int(255) NOT NULL,
`album_id` int(255) NOT NULL,
`disc` int(3) NOT NULL,
`track_no` int(3) NOT NULL,
`title` varchar(255) NOT NULL,
`length` time NOT NULL,
`size` decimal(20,1) NOT NULL,
`plays` int(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `artist_id` (`artist_id`,`album_id`,`disc`,`track_no`,`title`)
) ;
どんな助けでも大歓迎です。私は初心者です!!!