
September 29th, 2004, 01:22 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
SQL query help
good day to all. im using this sql query to view data from postgres:
Code:
SELECT cocv.personality_id, province_code, municipality_code, votes, personalities.personality_nam_last, personalities.personality_nam_first,
certificates_candidacy.position_id, position_prov_ipd_id, position_munc_ipd_id, leg_dist_ipd_id
FROM (cocv INNER JOIN personalities
ON cocv.personality_id = personalities.personality_id) INNER JOIN certificates_candidacy
ON cocv.personality_id = certificates_candidacy.personality_id
WHERE certificates_candidacy.position_id = '30'
and it gives me result of 10,000 records. but when i add this GROUP BY aggregate the result was lessen to 8,000 only. why it does like that?
Code:
GROUP BY personalities.personality_nam_last, personalities.personality_nam_first, cocv.personality_id, province_code, municipality_code, votes,
certificates_candidacy.position_id, position_prov_ipd_id, position_munc_ipd_id, leg_dist_ipd_id;
can anyone help me out with this?
|