SELECT
challenger_name as name,
IF(challenger_timeout > challenged_timeout,
(SET wins + 1),
NULL) as wins,
IF(challenger_timeout < challenged_timeout,
(SET lose + 1),
NULL) as lose,
IF(challenger_timeout = challenged_timeout,
(SET draw + 1),
NULL) as draw
FROM time_trial_challenge
GROUP by challenger_name ORDER by wins DESC";
如何解決此查詢?通過邏輯表達式選擇mysql字段
我希望你知道我想從這個查詢做什麼。 我很難將它們描述成句子
SUM(challenger_timeout> challenged_timeout)作爲勝利做同樣的事情 – Naktibalda 2010-07-22 12:14:12
SUM(challenger_timeout> challenged_timeout)我試過這個,但它給了我所有行的數字,包括challenger_timeout
bbnn
2010-07-22 13:22:13
@bn:請發佈您修改後的查詢 – ceteras 2010-07-22 13:51:48