Jump to content

UPDATE and JOIN and GROUP BY?


dahousecat

Recommended Posts

Hi There,

 

I hope someone can help as I'm getting rather confused...

 

I have two tables:

 

ClicksData

ClickDate

Clicks

Impressions

OperatorID

 

and

 

Operators

ID

SiteType

 

I have written this SELECT query that successfully filters, joins and groups both tables:

 

SELECT `CD`.`ClickDate`, `CD`.`Clicks`, `CD`.`Impressions`, `OP`.`SiteType`, `OP`.`ID` 
FROM `clicksdata` AS `CD` 
LEFT JOIN `operators` As OP
ON `CD`.`OperatorID` = `OP`.`ID`
WHERE `CD`.`ClickDate` >= '2009-09-01' AND `CD`.`ClickDate` <= '2009-11-01' AND `OP`.`ID` = 48 AND `OP`.`SiteType` = 'Free Bingo'
GROUP BY `CD`.`ClickDate`

 

However I would like to turn this into an UPDATE query so I can store the result in a temp table for later use.

 

I'm not even sure if it's possible to combine all these functions in one query - can anyone advise?

 

Cheers,

Felix

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.