Journey of Life: sqlite 3 string to integer conversion, similar to C function atoi
2013-01-07 10:25
453 查看
Journey of Life: sqlite 3 string to integer conversion, similar to C function atoi
CAST(expr AS type)
For example: you have a column named "version", and you stored value "11" in it. Now you can convert that to integer by doing:
Select * from mytable where CAST(version as integer)>=11;
Hope this helps you.
sqlite 3 string to integer conversion, similar to C function atoi
In sqlite3, if you have a column defined as string, but you want to use it as integer when doing comparison, you can do the following to convert it.CAST(expr AS type)
For example: you have a column named "version", and you stored value "11" in it. Now you can convert that to integer by doing:
Select * from mytable where CAST(version as integer)>=11;
Hope this helps you.
相关文章推荐
- Leetcode 8. String to Integer (atoi) The Solution of Python
- [LeetCode OJ]ZigZag Conversion && Valid Sudoku && String to Integer (atoi)
- LeetCode 8. String to Integer (atoi)
- String to Integer (atoi)
- leetcode --8. String to Integer (atoi)
- 【leetcode】String to Integer (atoi)
- String to Integer (atoi)
- LeetCode之 String to Integer (atoi)
- Leetcode: String to Integer (atoi)
- 8、LeetCode--String to Integer (atoi)
- [Leetcode] String to Integer (atoi)
- leetcode - String to Integer (atoi)
- String to Integer (atoi)
- LeetCode 8 String to Integer (atoi)
- String to Integer (atoi)
- Leetcode - 8.String to Integer (atoi)
- LeetCode之8----String to Integer (atoi)
- LeetCode-String to Integer (atoi)-状态机简单搜索
- 【LeetCode笔记】String to Integer (atoi)
- 8.[LeetCode]String to Integer (atoi)