Re: Counting booleans in GROUP BY sections

2019-11-30 Thread Adrian Klaver
On 11/30/19 4:08 AM, Alexander Farber wrote: My context is that I have a table of player moves with PK mid (aka "move id"). And I am able to find "interesting" moves by the high score or all 7 letter tiles used. But I do some human reviewing and set a "puzzle" boolean for truly interesting

Re: Counting booleans in GROUP BY sections

2019-11-30 Thread Alexander Farber
My context is that I have a table of player moves with PK mid (aka "move id"). And I am able to find "interesting" moves by the high score or all 7 letter tiles used. But I do some human reviewing and set a "puzzle" boolean for truly interesting moves. For the reviewing tool I would like to disp

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Adrian Klaver
On 11/29/19 11:47 AM, Alexander Farber wrote: Thank you Adrian, but - if I remove GROUP BY mid, then I get the error: ERROR:  42803: column "words_moves.mid" must appear in the GROUP BY clause or be used in an aggregate function LINE 18:         mid,                  ^ LOCATION:  check_un

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread David G. Johnston
On Fri, Nov 29, 2019 at 12:48 PM Alexander Farber < alexander.far...@gmail.com> wrote: > > if I remove GROUP BY mid, then I get the error: > > ERROR: 42803: column "words_moves.mid" must appear in the GROUP BY clause > or be used in an aggregate function > LINE 18: mid, >

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Alexander Farber
Thank you Adrian, but - On Fri, Nov 29, 2019 at 6:45 PM Adrian Klaver wrote: > On 11/29/19 8:38 AM, Alexander Farber wrote: > > > > CREATE OR REPLACE FUNCTION words_list_puzzles( > > in_start interval, > > in_end interval > > > > ) RETURNS TABLE ( > >

Re: Counting booleans in GROUP BY sections

2019-11-29 Thread Adrian Klaver
On 11/29/19 8:38 AM, Alexander Farber wrote: Good evening, I am trying to count the booleans per each GROUP BY section by the following stored function: CREATE OR REPLACE FUNCTION words_list_puzzles(                 in_start interval,                 in_end interval         ) RETURNS TABL

Counting booleans in GROUP BY sections

2019-11-29 Thread Alexander Farber
Good evening, I am trying to count the booleans per each GROUP BY section by the following stored function: CREATE OR REPLACE FUNCTION words_list_puzzles( in_start interval, in_end interval ) RETURNS TABLE ( out_label text,