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
https://forums.phpfreaks.com/topic/179471-update-and-join-and-group-by/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.