Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with combining 2 Query to 1 table

Status
Not open for further replies.

michaela18

Technical User
Sep 9, 2009
37
US
I want to combine these 2 queries into 1 table that looks like


Month 1st 7 in month
Line Code Views Sales Views Sales





SELECT GA.Line_code, GA.Views, GA.sales, i.description

FROM GA_sales_table GA, I_description_table I
WHERE GA.Line_code = i.id
AND i.description NOT LIKE '%Shoes%' OR '%bags%'
AND GA.Date BETWEEN '2011-03-01' AND '2011-03-28'




The query below is not what I want it to output. I just don't know how to write it. I basically want to compare the first 7 days of the line code to the entire month of the line code. But not all line code start at 3-01. How can I write it such that I only want to start counting from the first day it has data for any line code.

SELECT agg.io_line_item_id, agg.impressions, agg.clicks, i.description
SELECT GA.Line_code, GA.Views, GA.sales, i.description

FROM GA_sales_table GA, I_description_table I
WHERE GA.Line_code = i.id
AND i.description NOT LIKE '%Shoes%' OR '%bags%'
AND GA.Date BETWEEN '2011-03-01' AND '2011-03-07'
AND agg.impressions > 100
 
Perhaps if you showed us some data examples and what you expect the out come to be it would be easier to help you.

Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top