Help with multiple SELECT statements

  • I was hoping to get some assistance with the query below. I was able to create the individual SELECT statements against the Pubs database in SQL Server 2008 R2, but I am not sure how to join them as one select query, so the results come up in one table and not three individual tables:

    Scenerio:

    Add a view called StoreSales_vw in the Pubs database that shows the store name from all stores in California that match this criteria in the sales table:

    • sales with quantities greater than 20

    • payterms greater than 'Net 30'.

    Run a SELECT query on the view

    What I have come up with:

    SELECT * FROM stores WHERE state= 'CA'

    SELECT * FROM sales WHERE payterms='Net 30'

    SELECT * FROM sales WHERE qty >=’20’

    *Any help or input would be appreciated

  • you need to head to the other thread since its an exact copy of this post. posting again will only tick people off and cause them to not help. if you did not find the answer in your original thread ask more questions there.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply