2013-10-26 48 views
-8

我有一個表,其中包含名爲'extension'的列及其varchar類型。現在查詢> =和< =沒有顯示準​​確的結果。正在顯示只有最後的< =數字結果..Mysql Query for> = and <=沒有顯示正確的結果

這是我的查詢。

SELECT *,date(calldate) as date,time(calldate) as time FROM data_table 
where date(calldate) between '2010-10-01' and '2013-10-01' 
and cast(extension as signed) >=00 And cast(extension as signed) >=11111 
ORDER BY id asc LIMIT 0 , 50 

上執行給定的查詢結果來了只爲提前「11111」不是00和11111

任何幫助將不勝感激.. 感謝擴展..

+3

也許是因爲你有'= 11111'而不是'<= 11111'。 – JJJ

+0

如果'extenstion'必須大於或等於'11111',它永遠也不會是'0' –

+0

爲什麼要添加一個'00'?看起來你認爲它是一個字符串:/ –

回答

0
cast(extension as signed) <=11111