Tuesday, June 29, 2010

problem with JOINs

hi all,

          i am trying to join more than one table using joins but i am unable to check conditions in that one. anybody tell me what is best to write joins.

and tell me any one cakerelated query..


SELECT DISTINCT `csd`.`store_id` , `csd`.`date` , `c`.`campaign_id` , `c`.`supplier_id` , `cm`.`sub_category_id`
FROM `campaign_store_dates` AS `csd`
LEFT JOIN `campaigns` AS `c` ON `csd`.`campaign_id` = `c`.`campaign_id`
LEFT JOIN `campaign_media` AS `cm` ON `c`.`campaign_id` = `cm`.`campaign_id`
WHERE `c`.`status` NOT
IN (
'request', 'cancelled'
)
LIMIT 0 , 30



Thanks in Advance,
Rakesh

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: