Hi
my table contains 10000 lines.
my second table contains 8000.
i want to update 1st table's column "present" based on second table.
i a person i 1st exists in 2nd table, 1st's "present" will get 1, else = 0.
the code should be like:
surely the last row is wrong. can i update a table inside a select query ? I really dont know how to approach it.
i wish someone could help me with that..
Thanks
my table contains 10000 lines.
my second table contains 8000.
i want to update 1st table's column "present" based on second table.
i a person i 1st exists in 2nd table, 1st's "present" will get 1, else = 0.
the code should be like:
Code:
select a.present, b.name
from
first as a full join second as b
if exists a.name=b.name then a.present=1 else a.present=0
i wish someone could help me with that..
Thanks