Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Evaluating a string

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello!

I want to know if you can "evaluate" a string in SQL,
preferrably Oracle-SQL. I want "2+4+5+1" to be calculated
into "12".

Thanks

/Fredrik M
 
Use the dummy SQL table DUAL, which allows you to perform your calculation while conforming to the usual SQL syntax.

Eg.
Code:
select 2+4+5+1
from dual;

> 12
DUAL is handy for many operations where you don't actually need to retrieve table data eg select sysdate from dual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top