![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, this surprised me: select dr_cat,sum(dr_c1_amt) from r_amount group by dr_cat; dr_ca t | sum 1 | 175.00 2 | 30.00 (2 rows) next add another table select dr_cat,sum(dr_c1_amt) from r_amount where categories.ca_jud_apply='Y' group by dr_cat; dr_cat | sum 1 | 4200.00 2 | 720.00 (2 rows) 24 categories rows where ca_jud_apply='Y' 175 * 24 = 4200 30 * 24 = 720 No question. Just FYI Cannot join you in being suprised about an unexpected result when using an |
#3
| |||
| |||
|
|
Hello, this surprised me: select dr_cat,sum(dr_c1_amt) from r_amount group by dr_cat; dr_ca t | sum 1 | 175.00 2 | 30.00 (2 rows) next add another table select dr_cat,sum(dr_c1_amt) from r_amount where categories.ca_jud_apply='Y' group by dr_cat; dr_cat | sum 1 | 4200.00 2 | 720.00 (2 rows) 24 categories rows where ca_jud_apply='Y' 175 * 24 = 4200 30 * 24 = 720 |
#4
| |||
| |||
|
|
PaulS <semenick (AT) ix (DOT) netcom.com> wrote: Hello, this surprised me: select dr_cat,sum(dr_c1_amt) from r_amount group by dr_cat; dr_ca t | sum 1 | 175.00 2 | 30.00 (2 rows) next add another table select dr_cat,sum(dr_c1_amt) from r_amount where categories.ca_jud_apply='Y' group by dr_cat; dr_cat | sum 1 | 4200.00 2 | 720.00 (2 rows) 24 categories rows where ca_jud_apply='Y' 175 * 24 = 4200 30 * 24 = 720 You're right, that's surprising. I would have expected the following result from the second query: ERROR: missing FROM-clause entry for table "categories" What version is this? How is the definition of r_amount? Yours, Laurenz Albe |
#5
| |||
| |||
|
|
"Laurenz Albe" <invite (AT) spam (DOT) to.invalid> wrote in message select dr_cat,sum(dr_c1_amt) from r_amount where categories.ca_jud_apply='Y' group by dr_cat; dr_cat | sum 1 | 4200.00 2 | 720.00 You're right, that's surprising. I would have expected the following result from the second query: ERROR: missing FROM-clause entry for table "categories" What version is this? How is the definition of r_amount? Yours, Laurenz Albe here's what I have on version 7.3.3 |
![]() |
| Thread Tools | |
| Display Modes | |
| |