sql - postgres: use of CASE and ANY() in WHERE clause -


is there way make work?

select * table t inner join othertable t2 using (tid) t.tid = case     when t2.someboolval any(array[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])     else any(array[77,66]) end 

unfortunately can't t.tid = case when t2.someboolval 1 else 2 end because need match against array. doable?

use and/or. like:

  select   *   table t   inner join othertable t2 using (tid)        t2.someboolval , t.tid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)       or not (t2.someboolval) , t.id in (77,66) 

edit: formatted


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -