| Am I correct in assuming that PB (or the server itself -- I'm presently
| developing under WATCOM but will be migrating to Sybase) does not allow
| nested queries/sub-queries??? Is this a limitation of embedded SQL since
| only one row can be returned or a "feature"??? Thx...
Correct. The embedded SQL in PowerScript doesn't recognize sub-queries.
But you could instead use dynamic SQL, something like
EXECUTE IMMEDIATE "select ... from ... where exists (select ...)"
Dynamic SQL is not parsed by PowerScript parser. It'll be send to the
server "as is" (and get a runtime error from the server if there's syntax
Qing Vincent Yin | Repeat
| Until 0 = 1;
I'd like to be able to query a single table of the following format:
And what I'd like to do is something like the following:
Given a range of dates, select the following data:
(DEPARTMENT,THIS YEAR TOTAL PRICE, LAST YEAR TOTAL PRICE)
I can figure out how to do this for _JUST_ this year and for just _LAST_
year. I would think to potentially do this into two datawindows and
then create a third datawindow that would join based on the DEPARTMENT
field. But I don't see a way of doing that. I could do both selects
into individual datawindows, save both datawindows and then import the
data, but that seems like an awfully awkward solution.
If anyone has found a clean way of doing a query like this in PB, I'd
appreciate knowing how.
Thanks in advance,
3. Query query
10. Nested Queries
11. Nested queries