![]() |
| Sponsored Links (We share ad revenue): |
|
|
Re: two tables in Access. Help please. |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
You need to include B in your from clause. Then you need to either create a join clause (FROM A JOIN B ON A.x = B.x) or put the condition in your WHERE clause that will tell the database engine how to combine the tables. Which it looks like you already have.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: two tables in Access. Help please. |
|
tired of the day job
Posts: 88
|
Thanks Newbie. Talkupation added.
I had to use the JOIN to get it working. I'll know next time. |
|
|
|
|
|
Re: two tables in Access. Help please. |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,068
Name: John Alexander
|
I've never looked into the performance implications of each, but with a smart query optimizer I think they'd be the same. Thanks for the TP (!), and now that you've figured it out, I'll spill the answer for others. If that sounds mean, since you went and figured it out and implemented it yourself, like you said, you'll remember in future, so it's actually valuable to wait with the answer.
SELECT area FROM A INNER JOIN B ON B.area = A.area Or SELECT area FROM A, B WHERE B.area = A.area;The second one is the old ANSI SQL way of doing it. I think most people prefer the JOIN syntax. If the query processor isn't in top shape, I think JOIN might be a little faster, but they're probably the same.
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |