Nested queries/sub-queries...

Nested queries/sub-queries...

Post by Thomas Roc » Fri, 29 Jul 1994 02:53:37



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...
 
 
 

Nested queries/sub-queries...

Post by Qing Y » Fri, 29 Jul 1994 12:47:28



| 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
error.)
--

Qing Vincent Yin                |       Repeat

                                |       Until 0 = 1;

 
 
 

1. Querying against a DataWindow - or - How to do this query?

I'd like to be able to query a single table of the following format:

(DATE,DEPARTMENT,PRICE,QUANTITY)

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,
-Gavin Stark

2. lockup

3. Query query

4. CDO addAttachment failed in C#, but works fine in VB

5. Subselect query for a multi table insert single query

6. FS: ONYX 2 InfiniteRealilty

7. VMware query / Acme query

8. xda battery problem

9. problem with outer union with nested queries

10. Nested Queries

11. Nested queries