how to update like this? (SQL) -


i have 3 databases: service1, businessrecord, , teamastaffno

1)i want identify the service type in 2 type "play" , "mainbusiness" , "error"

-if businessrecord.type "play" "play"

-if businessrecord.other match service1.servicetype "mainbusiness"

-if fulfill 2 option should show "error"

2) want business record match teamastaffno.staffno only, because want team record.

3) finally, want table have cloumn order_type show "play", "mainbusiness", "error" , "duplicate"

than, sql code?

and type

    select businessrecord.type, businessrecord.other, businessrecord.staffno; service1;     join  businessrecord;         on businessrecord.other = service1.servicetype;     inner join teamastaffno;         on businessrecord.staffno = teamastaffno.staffno 

and record copy table proc1

alter table proc1 add order_type char(50)  update order_type "mainbusiness" businessrecord.type service1.servicetype update order_type "duplicate" order_type "mainbusiness" , type "play" update order_type "play" other "play"  update order_type "error" order_type null 

what doing wrong?

if using 2 table should use join function , how code?

your update syntax incorrect

update <tablename> set <columnname> = <somevalue> <predicate> 

some dbms' let join update

update alias1 set alias1.column = 'somevalue' table1 alias1 join table2 alias2 on alias1.id = alias2.foreignid alias2.somecolumn = 'blah' 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -