If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Nameing a sub query for access to handle.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 10:26
Matt_T_hat Matt_T_hat is offline
Registered User
 
Join Date: Sep 2003
Location: UK
Posts: 122
Nameing a sub query for access to handle.

I have been tasked with compleating this conversion asap.

I have been removeing functions that use dlookup from the queries of an important DB.

I have so far halved the delay time by simply makeing one of the two main problems redundant.

Now I must use SQL to remove the other.

What I plan is to create is a query with a subquery

from [foo]
where
(
bar bar bar
) ????
join etc


How do I refer in the join to the sub query. ie what do I call it and how do I declar that...
__________________
Matt the Hat says: "what!?"
A child of five could understand this! Fetch me a child of five!
SCARY HARD CHALLENGE: http://www.dbforums.com/database-concepts-design/988682-better-relational-design.html
Reply With Quote
  #2 (permalink)  
Old 04-19-04, 14:11
pinakdb pinakdb is offline
Registered User
 
Join Date: Feb 2004
Posts: 108
Give an alias to your subquery.

SELECT some_cols
FROM T1, ( SELECT FewCols FROM T2 WHERE some_cond) CondT2
WHERE T1.ID = CondT2.SomeID

Hope this helps.
Reply With Quote
  #3 (permalink)  
Old 05-29-04, 13:52
Matt_T_hat Matt_T_hat is offline
Registered User
 
Join Date: Sep 2003
Location: UK
Posts: 122
Talking thankyou

That was great. I have ended up with a union query nested inside a query linked to a table and nested inside a query


phew!
__________________
Matt the Hat says: "what!?"
A child of five could understand this! Fetch me a child of five!
SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On