hi,
raptor(at)tvskat(dot)net wrote:
> create view as select
> t1.id, t1.date, t1.field1, t1.field2,
> t2.fieldA, t2.fieldB,
> state, stuff
> from table1 as t1, table2 as t2
> where t1.id = t2.fkID
>
>
>>>WHERE "state" is caluclated like this :
>
>
> state = 'red' if date > today
> state = 'green' if date < today
> state = 'blue' unless date
>
>
>>>AND 'stuff' is concatenation of t1.field2 and t2.fieldA.
> can this be done, if yes how.
try with case:
case when date > current_timestamp then 'red' when date <
current_timestamp then 'green' else 'blue' end as state,
t1.field2||t2.fieldA as stuff
C.