>>>>> "Andrew" == Andrew Perrin <clists@perrin.socsci.unc.edu> writes:
Andrew> What I've done is to write a script that counts the number Andrew> of eligible exposure candidates:
Andrew> SELECT count(*) FROM participants WHERE <eligibility> Andrew> AND typenr=1
Andrew> Then subtract that number (currently 28) from 200 to get Andrew> 172 control participants. Then the
problemstarts.
[...]
Andrew> returns ERROR: parser: parse error at or near "ORDER"
Can you do this via a subselect:
SELECT * FROM ( SELECT ... FROM participants WHERE typenr=1 AND <eligibility> UNION SELECT ... FROM
participants WHERE typenr=2 LIMIT 172 )
ORDER BY zip;
roland
-- PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland@rlenter.com 76-15 113th Street, Apt 3B
roland@astrofoto.org Forest Hills, NY 11375