Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 11320
  • Last Modified:

Will To_Number work in mysql and sql?

I have a query in oracle:

query = "SELECT * FROM REGIONS ORDER BY To_Number(RID) DESC";

will the same querry work in mysql and sql?
0
Millkind
Asked:
Millkind
2 Solutions
 
Helena Markováprogrammer-analystCommented:
It seems to me that in SQL server there is something like Is_Number() instead of To_Number() there.
You can create a pointer question to this one in a Database area, you will, I hope, get more answers.
0
 
slightwv (䄆 Netminder) Commented:
First I agree.  Posting this into the generic Database forum will get the best response.  MySQL people probably don't make it down here.

I'm not a MySQL person but from a quick read of the docs, the answer is NO.  MySQL does not have a to_number function. MySQL and Oracle appear to have a similar CAST function so:

SELECT * FROM REGIONS ORDER BY CAST(RID as number) DESC

should work in both.

Check out:
http://mysqld.active-venture.com/Cast_Functions.html
and/or
http://dev.mysql.com/doc/mysql/en/index.html
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now