?
Solved

Will To_Number work in mysql and sql?

Posted on 2005-03-30
2
Medium Priority
?
11,160 Views
Last Modified: 2013-12-11
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
Comment
Question by:Millkind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Assisted Solution

by:Helena Marková
Helena Marková earned 252 total points
ID: 13669966
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
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 248 total points
ID: 13672313
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question