"ORA-01427: Single-row subquery returns more than one row"
Just a question, because I want to know if it is possible:
SELECT ...
,....
-- subquery
,(SELECT t1.val
FROM table 1 t1
,tabel 2 t2
,tabel 3 t3
WHERE t1.UIDxxxxx = t2.UIDUIDxxxxx
and etc
and lct.STARTTIME between to_date('01-01-2014 00:00:00', 'dd-mm-rrrr HH24:mi:ss') and to_date('31-12-2014 23:00:00', 'dd-mm-rrrr HH24:mi:ss')
) as result
FROM .....
WHERE main where clause
The subquery has a relation with the main query. But the subquery returns 12 value's and therefore I do get the error. I understand that
But I'm not so familiar with SQL, is it possible to do this with the construction as I wrote here before? (The values may al be returned in one field like seperated by a space or ';')
I know a (or the) workaround like repeat the subquery 12 times, for every month 1 time.
Another construction is off course to add in or another way to add this to the main query, but my main query already exist from 12 tables.
Nico