Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum two number using oracle sql

When I want to get a sum of two numbers in mysql I can just use

select 10 + 15;

However, when I try the same in oracle sql i get the following error.

ORA-00923: FROM keyword not found where expected

What would be the correct way to sum two numbers?

like image 345
jan-seins Avatar asked Mar 21 '26 21:03

jan-seins


1 Answers

oracle doesn't allow queries without a from clause. You could use the dual dummy table for such purposes:

SELECT 10 + 15 FROM dual;
like image 176
Mureinik Avatar answered Mar 24 '26 01:03

Mureinik