Sven,
Thank You very much for your answer.
> The above query doesn't make any sense.
Of course, I agree. It was just a simple example
which I send here - in real my subquery was much more
complicated and even correlated. But I was geeting toward
simpler statements and noticed that even the simplest doesn't work.
Anyway, Your hint made me think about using joins and
it works perfectly now.
And by the way - my query looks like:
SELECT A.ID, A.DATEWEEK,A.FORECAST,(B.BRAND_SUM/A.FORECAST) AS STD_ERR
FROM MY_TABLE A JOIN(
SELECT DATEWEEK,SUM(FORECAST) AS BRAND_SUM FROM MY_TABLE
GROUP BY DATEWEEK)B
ON A.DATEWEEK = B.DATEWEEK
And works great. But whenever I try to make
a view for it, I get the error:
-9000 POS(1) System error: Not yet implemented: SELECT IN FROM PART OF VIEW.
Anybody knows if it is already implemented in the latest 7.4 ?
Kind regards,
Marcin Pytel
Mr "Sven K�hler" <[EMAIL PROTECTED]> has written in
:news:[EMAIL PROTECTED]
> > What I try to execute is:
> > "SELECT ID,(SELECT SUM(PRICE) AS ALL_PRICES FROM MY_TABLE) FROM
MY_TABLE"
> >
> > Any hints?
>
> The above query doesn't make any sense. Beside that, i beleive that it's
> a bug in the checks that SAPDB performs. There are really sub-queries
> that aren't allowed, but this one could be allowed, although the query
> returns the same as
>
> SELECT a.ID, b.S
> FROM MY_TABLE a
> CROSS JOIN (SELECT SUM(PRICE) AS S FROM MY_TABLE) b
>
> and this query might perform better that yours, because it takes of the
> fact, the sub-query only returns one row that contains the same value
> for all possible values if ID.
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general