I want to achieve this:
SELECT * FROM linkledger WHERE toInt(reputation) > 100;
but the function toInt doesnt exist? Is there one?
I found this now but not working, which implies i have a more fundemental problem. BECAUSE THIS IS CORRECT
SELECT * FROM linkledger WHERE cast(reputation AS INTEGER) > 100;
CAST and CONVERT can be used to convert a string to a number of any data type. For example, you can convert a string to a number of data type INTEGER. TO_DATE converts a formatted date string to a date integer. TO_TIMESTAMP converts a formatted date and time string to a standard timestamp.
The TRY_PARSE() function can convert any string value to Numeric or Date/Time format.
You can cast data into BINARY, CHAR, DATE, DATETIME, TIME, DECIMAL, SIGNED, UNSIGNED data types. mysql> select cast(1 as char) from sales; You can also use MySQL CAST in WHERE clause.
Use CAST(reputation AS INTEGER)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With