BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sub Queries

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Joaquim Silva
Guest





PostPosted: Tue Aug 19, 2003 2:56 pm    Post subject: Sub Queries Reply with 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.
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





PostPosted: Tue Aug 19, 2003 3:05 pm    Post subject: Re: Sub Queries Reply with quote



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





PostPosted: Wed Aug 20, 2003 11:00 am    Post subject: Re: Sub Queries Reply with quote






Thanks a lot Ignacio.
It is working!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.