Select on Select - scalar subqueries

Database
Enthusiast

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
Tags (1)
3 REPLIES
Senior Apprentice

Re: Select on Select - scalar subqueries

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
Enthusiast

Re: Select on Select - scalar subqueries

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
Enthusiast

Re: Select on Select - scalar subqueries

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