hi ,
i have one problem with this query please help me. if iam using having cluase iam not getting records . if iam run from select to group by iam getting results . please help me how to use this query with having clause
SELECT
CONCAT(s.Skill,'(',es.Experience,' Months',')')AS Skills
FROM projectemployee p
LEFT OUTER JOIN employeeskills es ON p.EmployeeId =es.EmployeeId
LEFT OUTER JOIN skilllookup s ON es.Skill =s.SkillId
WHERE CURDATE() BETWEEN p.StartDate AND p.EndDate
GROUP BY p.EmployeeId
HAVING SUM(p.AllocationPercentage) < 100;
CONCAT(s.Skill,'(',es.Experience,' Months',')')AS Skills
FROM projectemployee p
LEFT OUTER JOIN employeeskills es ON p.EmployeeId =es.EmployeeId
LEFT OUTER JOIN skilllookup s ON es.Skill =s.SkillId
WHERE CURDATE() BETWEEN p.StartDate AND p.EndDate
GROUP BY p.EmployeeId
HAVING SUM(p.AllocationPercentage) < 100;

Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 5, 2015, 7:13 PM EST
padmapriya patruni75 reputationPosted Nov 5, 2015, 7:26 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 5, 2015, 7:57 PM EST
Hi,
Please verify the data in SUM(p.AllocationPercentage) column, using query which have provided. any record has SUM(p.AllocationPercentage) column less than 100?