All pastes #450443 Raw Edit

Mine

public sql v1 · immutable
·published 2007-04-20 21:12 UTC
rendered paste body
/* this is the table... the error is: *ERROR:  Unknown column 'crm_groups_sub.leadId' in 'on clause'  *//* TABLE */CREATE TABLE `crm_groups_sub` (  `subId` int(11) NOT NULL auto_increment,  `userId` int(11) NOT NULL,  `companyId` int(11) NOT NULL default '0',  `groupId` int(11) NOT NULL default '0',  `leadId` int(11) NOT NULL default '0',  `receiveGroupEmails` char(3) NOT NULL default 'YES',  `receiveSeriesEmails` char(3) NOT NULL default 'YES',  `receiveFeedbackEmails` char(3) NOT NULL default 'YES',  `dateSubscribed` int(11) NOT NULL default '0',  `seriesScore` float NOT NULL default '0',  `readOnly` char(3) NOT NULL default 'NO',  PRIMARY KEY  (`subId`),  KEY `groupId` (`groupId`,`leadId`),  KEY `companyId` (`companyId`)) ENGINE=MyISAM AUTO_INCREMENT=12489 DEFAULT CHARSET=latin1 AUTO_INCREMENT=12489 ;/* QUERY */SELECT lp_funnel.funnelId,  'main' AS contactId, lp_funnel.firstName, lp_funnel.lastName, CONCAT( lp_funnel.firstName,  ' ', lp_funnel.lastName ) AS fullName, lp_funnel.companyName, lp_funnel.email1, lp_funnel.title, crm_groups_sub . * FROM crm_groups_sub, lp_powerseriesJOIN lp_funnel ON lp_funnel.funnelId = crm_groups_sub.leadIdWHERE lp_powerseries.seriesId =  '11'AND lp_powerseries.groupId = crm_groups_sub.groupIdAND crm_groups_sub.receiveSeriesEmails =  'YES'AND length( lp_funnel.email1 ) >1LIMIT 0 , 30