postgresql condition column name = data -
i have 3 tables.
table | uid | name | number | |-----+---------+--------| | 1 | table | 1 | | 2 | chair | 2 | table b | uid | name | number | |-----+---------+--------| | 1 | john | 1 | | 2 | billy | 0 | | 3 | bob | 2 | | 4 | sally | 1 | table c | uid | table | john | billy | bob | sally | |-----+---------+--------+--------+-------|-------| | 1 | table | t | | | t | | 2 | chair | | | c | |
what need able @ column names in table c, find corresponding row entry in table b , if numbers same numbers table a, set table c value t. otherwise set c. needs triggered whenever either table or table b updated.
how can write update table using if or case statement. thanks.
Comments
Post a Comment