Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language 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
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old December 22nd, 2010, 06:39 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

And before you ask, let's show one more simple variation on that:
Code:
SELECT vendorName 
FROM Vendors 
WHERE vendorID IN (
      SELECT O.VendorID
      FROM Orders AS O, Customers AS C
      WHERE O.customerID = C.customerID 
        AND C.State IN('WA','OR','CA') ) 
AND vendorID NOT IN (
      SELECT O.VendorID
      FROM Orders AS O, Customers AS C
      WHERE O.customerID = C.customerID 
        AND C.State IN ('ME','NH','VT','MA','CT','RI') )
That gets all vendors who have sold in the 3 West Coast states but have never sold to any state in New England. Okay? You can see there are lots of ways to vary this.
Reply With Quote
The Following User Says Thank You to Old Pedant For This Useful Post:
03jh01 (December 22nd, 2010)
  #12 (permalink)  
Old December 22nd, 2010, 07:42 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 7
Thanked 0 Times in 0 Posts
Default

I cannot thank you enough for helping me out here. That is just what I needed (for you to go through one of the queries step by step)!

I have been programming C# for about 5 months now, and I would call myself intermediate in that at the moment. I think I should be in a position to advance to a higher level in SQL quite quickly... I hope :).

SQL looks quite simple on the face of it, but it's not until you start properly trying to learn it that you see that that isn't necessarily always the case.

As for the queries that took up 4 to 5 pages...woah. I would love to see those! What sort of queries are they? My naive SQL mind can't even imagine what you would be querying for it to take up that many pages :).

Anyway, thanks again, you couldn't have helped me out anymore if you tried.

See you around no doubt :).
Reply With Quote
  #13 (permalink)  
Old December 22nd, 2010, 08:02 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Sorry...can't show them to you. Proprietary. Briefly, they are stored procedures (so in reality maybe 10 different queries in one?) that do statistical analysis of time series data.
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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which storage engine for "Post for sell goods" website taev MySQL 2 May 8th, 2009 02:53 PM
Sell more books Paulpdy BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 6 February 5th, 2009 05:30 PM
who can help me to sell software laolai12 Flash (all versions) 0 June 18th, 2008 03:38 AM
cheap brand shoes sell saler VBScript 0 November 26th, 2007 07:12 AM
How to Sell PRODUCTS in the own site? Salar Beginning PHP 1 August 3rd, 2005 02:26 PM



All times are GMT -4. The time now is 06:26 PM.


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