# Pastebin I1tlJXWM $ perl6 -Ilib -e 'use Red; model M is table { has Str $.a is column; has Bool $.b is column; has Str $.c is column } my $*RED-DB = database "SQLite"; M.^create-table; my $*RED-DEBUG = True; say M.^all.map: { .b ?? .a !! .c } ' SQL : SELECT CASE WHEN (b == 0 OR b IS NULL) THEN c WHEN (b <> 0 AND b IS NOT NULL) THEN a END as "data" FROM mmm ()