1
快速提問;有沒有辦法在select語句上應用數字類型?SQL:無小數點返回百分比
〔實施例使用
select (t1.f_count/(select count(*) from utb where user_id = 1))*100 as ratio
我需要這個來回報60,而不是60.0000
快速提問;有沒有辦法在select語句上應用數字類型?SQL:無小數點返回百分比
〔實施例使用
select (t1.f_count/(select count(*) from utb where user_id = 1))*100 as ratio
我需要這個來回報60,而不是60.0000
嘗試
select ROUND((t1.f_count/(select count(*) from utb where user_id = 1))*100) as ratio
缺少 '(' 輪 – Joshua 2009-09-08 18:57:31
確實後,現在固定:) – Pomyk 2009-09-08 19:05:01
謝謝非常 – ryan 2009-09-08 19:16:58