Paul Sanderson wrote:
>   (CASE visits.transition & 0xFFFFFF00  WHEN 0x00800000 THEN 'Blocked'       
> ELSE '' END ||
>    CASE visits.transition & 0xFFFFFF00  WHEN 0x01000000 THEN 'Forward_Back'  
> ELSE '' END ||
>    ...
>
> The query seems to work OK if a single bit is set, but fails (a blank string
> is returned) when multiple bits are set. Any ideas why?

When multiple bits are set, the value of visits.transition & 0xFFFFFF00
is something like 0x01800000.

Don't bother with the extra bit mask, just check individual bits:

  (CASE WHEN visits.transition & 0x00800000 THEN 'Blocked'       ELSE '' END ||
   CASE WHEN visits.transition & 0x01000000 THEN 'Forward_Back'  ELSE '' END ||
   ...


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to