Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vickrr1z
Starting Member
1 Post |
Posted - 2004-03-25 : 07:05:12
|
| Hi, im using Postgresql [psql]let say i have tables party_list_cocv, party_lit_orgs and municipalities:in table party_list_cocv each municipality has complete of 162 party_list of votes, and there's someothers are incomplete or less than 162.. these was caused due from encoding phase.i post this as sample of my query:SELECT count(municipality_code) As total_rec FROM party_list_cocv INNER JOIN municipalitiesUSING (municipality_code) INNER JOIN party_list_orgs ON party_id = party_listWHERE municipality_code = '980106000';result gives:total_rec------- 159(1 row)now what i want to do is selecting all the records of municipality which was only a countless than 161. i did this way but gives me error but i know its really not appropriate?SELECT province_code, municipality_name count(municipality_code) As total_rec FROM party_list_cocv INNER JOIN municipalitiesUSING (municipality_code) WHERE total_rec <= 161;-----the error: "ATTRIBUTE 'total_rec' not foundDoes anyone know how I can do this? any suggestions would be greatly apreciated.Thanks very muchMabuhay!!! |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-03-25 : 07:56:57
|
| For a start this is a MS$ SQL site...postgresql support is not quite our cup of tea.however at a glance, you seem to missing a ',' between "municipality_name" and "count(" |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-25 : 08:38:11
|
http://www.dbforums.com/f81/ will be a better place for your question, methinks. --Frankhttp://www.insidesql.de |
 |
|
|
|
|
|