I need a couple SQLite select queries. Here are the two tables (all columns you will be dealing with are VarChar):
codes -- codeID, product, code, linkurl, category, comment, pagetitle
trackdata -- trackID, code, campaign, ip, hittime, referer, site
1. The first query only deals with the trackdata table. Here's what I want it to return, in plain English -- Give me all distinct campaign as well as how many times that campaign appears where code = a code that I specify.
If I pass in aweber as the code, I'm loooking to get back something like this:
aweber,list,34
aweber,web,49
aweber,ezine,76
The code will be the same for each one, but the campaign will be distinct and the count will be for that distinct campaign.
2. The second query I need pulls back data from trackdata and a matching column from codes. Here is the query I'm using now:
sql = "select [login to view URL] as code, count([login to view URL]) as numClicks, min([login to view URL]) as minClick , max([login to view URL]) as maxClick from trackdata td group by [login to view URL] order by numClicks desc"
But I also need it to include [login to view URL] where [login to view URL] = [login to view URL]
I know this is easy stuff for SQL coders, I just haven't done DB stuff in a while so I'm a little rusty. =:)
## Deliverables
1) Complete and fully-functional SQLite query.
2) Deliverables must be in ready-to-run condition, as follows? (depending on the nature? of the deliverables):
a)? For web sites or? other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software? installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
SQLite