All Forums Database
22 Jul 2011
Select on Select - scalar subqueries

Hi
I looked in the manual SQL Data Manipulation Language page 38. There is an example that I cannot make work.
(Very Simplified!!) here is what I am trying to do:

Select 1; ===> result in "1"

select 2; ===> result in "2"

now I Try to :

Select (Select 1), (Select 2); ===> I get the error message:

SELECT Failed. [3706] Syntax error; expected something between '(' and 'SELECT' Keyword.

on page 38 in the manual it says:
------------------------------------------------------ ------------------------------------------------------ ---
The following examples are a selection of the type of expressions that you can code using
scalar subqueries:
• Arithmetic expressions
SELECT (fix_cost + (SELECT SUM(part_cost)
FROM parts)) AS total_cost, …
• String expressions
SELECT (SELECT prod_name
FROM prod_table AS p
WHERE p.pno = s.pno) || store_no …
------------------------------------------------------ ------------------------------------------------------ ---

any help??

Peter Schwennesen

dnoeth 4628 posts Joined 11/04
22 Jul 2011

You try to submit that query on a pre-TD13 system.

Scalara Subqueries are fully supported for TD13, previously they were restricted to WHERE/HAVING.

Dieter

Dieter

UdayaChow 6 posts Joined 07/11
22 Jul 2011

Hi,

please verify the statement once because
the statement select (select 1),(select 2) doesn't gives the error it gives the output 1 2

UdayaChow

22 Jul 2011

OK. Maybe I am only having the version 12, and not the version 13.
Peter

You must sign in to leave a comment.