 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Joaquim Silva Guest
|
Posted: Tue Aug 19, 2003 2:56 pm Post subject: Sub Queries |
|
|
D6 E ; MSSQL 7
I made a query with a subquery in the SELECT statement
This subquery returns the SUM of QTY*price, for some lines,but QTY is on a table and the price on another one with the Lote N. related to the first table.
So the Sub Query is a Join of the two tables.
If in the outer SELECT I use WHERE number of the order = some few ones, ( 60 for exemple), everything runs OK, what I think that I can assume the Query is well done.
If I run all the orders I get a Server Time out.
I have not sent the Query List because is a long one and seems to work on few records.
Where is the problem?
TIA
|
|
| Back to top |
|
 |
Kevin Frevert Guest
|
Posted: Tue Aug 19, 2003 3:05 pm Post subject: Re: Sub Queries |
|
|
Joaquim,
Don't run the query on all the orders or increase the timeout.
krf
"Joaquim Silva" <jquim (AT) kqnet (DOT) pt> wrote
| Quote: |
D6 E ; MSSQL 7
I made a query with a subquery in the SELECT statement
This subquery returns the SUM of QTY*price, for some lines,but QTY is on a
table and the price on another one with the Lote N. related to the first |
table.
| Quote: | So the Sub Query is a Join of the two tables.
If in the outer SELECT I use WHERE number of the order = some few ones,
( 60 for exemple), everything runs OK, what I think that I can assume the |
Query is well done.
| Quote: | If I run all the orders I get a Server Time out.
I have not sent the Query List because is a long one and seems to work on
few records.
Where is the problem?
TIA
|
|
|
| Back to top |
|
 |
Joaquim Silva Guest
|
Posted: Wed Aug 20, 2003 11:00 am Post subject: Re: Sub Queries |
|
|
Thanks a lot Ignacio.
It is working!
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|