michaela18
Technical User
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
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