On Wed, Jan 20, 1999 at 08:01:38AM -0800, Jeremy Rusnak wrote:
> What's the easiest way to force the type to be numeric?  I looked
> in the docs for, say, an INT function...

mysql> select substring_index(invoice, '-', 1) as nmbr
    -> from tbl_name
    -> order by nmbr;
+------+
| nmbr |
+------+
| 1012 |
| 1013 |
| 900  |
+------+
3 rows in set (0.01 sec)

mysql> select substring_index(invoice, '-', 1)+0 as nmbr
    -> from tbl_name
    -> order by nmbr;
+------+
| nmbr |
+------+
|  900 |
| 1012 |
| 1013 |
+------+
3 rows in set (0.01 sec)

mysql> select version();
+-------------+
| version()   |
+-------------+
| 3.22.9-beta |
+-------------+
1 row in set (0.01 sec)

Tim
-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.

Reply via email to