看板 PHP 關於我們 聯絡資訊
select id, from_unixtime(mdl_log.time)as"to_FormalTime" from mdl_log where from_unixtime(mdl_log.time) between "2007-01-15-00-00-00" and "2007-01-22-00-00-00" ----------------------------------------------------上述結果正確 上述的where條件中並非使用別名to_FormalTime,但我想使用 to_FormalTime作為別名,變成像下面的sql...,但確出現錯誤。 select id, from_unixtime(mdl_log.time)as"to_FormalTime" from mdl_log where to_FormalTime between "2007-01-15-00-00-00" and "2007-01-22-00-00-00" ----------------------------------------------------上述結果有誤 mysql錯誤訊息,#1054 - Unknown column 'to_FormalTime' in 'where clause' 請問(1).為什麼別名會不認得? (2).如何修改? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.232.1.212 ※ 編輯: dinson520 來自: 125.232.1.212 (01/25 15:40)
dinson520:又或者是說,我該問的是巢狀的SQL怎麼寫? 01/25 15:53