Results 1 to 1 of 1
Thread: SQL Nightmare
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2005
- Charlottesville, VA
Is it possible (and feasible) to create a distribution with postgresql commands? I have a table called 'cif' that has columns 'cifid', 'r_factor', and 'progid' (cifid being the primary key, and r_factor being a real), and I would like to extract the number of entries that have an r_factor of less than .025, between .025 and .05, between .05 and .075, and greater than .075 (for each progid, if possible). Is this possible to do? Is it feasible to do? Or is it easier to run each sql statement seperately?
I know that to do it for a given range and a given progid, I can use the statement:
SELECT sum(count) FROM (SELECT DISTINCT count(1), r_factor FROM cif WHERE progid = 1 GROUP BY r_factor ORDER BY r_factor) AS foo WHERE r_factor < .025;
Thank you so much in advance.
Linux without a C Compiler is like eating Spaghetti with your mouth sewn shut. It just doesn't make sense.