Forum OpenACS Q&A: Response to ERROR in mailing-list/index .tcl

Collapse
Posted by Dan Wickstrom on
Oops. The query should be:
 "select c.category, c.category_id, 
                           case when ui.category_id is NULL then NULL::char else 't'::char end as selected_p
                      from categories c, users_interests ui
                     where c.enabled_p = 't' 
                       and ui.user_id = $user_id
                       and c.category_id = ui.category_id
           union all
                    select c.category, c.category_id, 
                           NULL::char as selected_p
                      from categories c
                     where c.enabled_p = 't' 
                       and not exists (select 1 from user_interests 
                                        where category_id = c.category_id 
                                          and user_id = $user_id)"

The new version is checked into cvs.