Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > BOOK: Beginning SQL
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning SQL
This is the forum to discuss the Wrox book Beginning SQL by Paul Wilton, John Colby; ISBN: 9780764577321
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SQL section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 18th, 2008, 06:45 PM
Registered User
 
Join Date: Sep 2008
Location: Behbahan, , Iran.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Difference Between This Two Query's

Hello All,

I write this query for Exercise 2 from Chapter 8 :
Code:
SELECT City, State
FROM MemberDetails AS MD1
WHERE(SELECT COUNT(*) FROM MemberDetails AS MD2 WHERE MD2.City = MD1.City
AND MD2.State = MD1.State) >= 2
AND MD1.City NOT IN (SELECT City FROM Location)
GROUP BY City, State;
And book answer use from Exists Operator :

Code:
SELECT City, State FROM MemberDetails AS MD1
WHERE(SELECT COUNT(*) FROM MemberDetails AS MD2
WHERE NOT EXISTS (SELECT * FROM Location AS L1 WHERE L1.City = MD2.City AND
L1.State = MD2.State)
AND MD1.City = MD2.City AND MD1.State = MD2.State
GROUP BY City,State)>=2
GROUP BY City,State ;
Please comparison this Query's in Speed and etc.

Thanks My Friends.:)
 


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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a difference? ironchef Java Basics 2 October 6th, 2006 03:26 AM
difference Y.Hashmi ADO.NET 1 September 19th, 2006 07:02 PM
How to check if query's are present in a database rmsmit VB How-To 6 December 13th, 2005 11:48 AM
what is the difference? chuck_schuldiner Javascript How-To 2 February 10th, 2005 01:46 AM
what is the difference between... chuck_schuldiner Javascript 2 February 10th, 2005 01:41 AM



All times are GMT -4. The time now is 03:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.