mysql join and issues with loading data -


i working mysql code , giving me headache, upload image of tables how , how trying fetch data.

http://pasteboard.co/1kqrvuvn.png

the issue is:

i in process of doing update/insert

so query trying fetch common results both tables , if there no common stuff, want load tasktemplates tables values new.

here query trying

so below query runs in loop every record , check if record exists in temple or task tale or not.

it works if no task found, not load templates table, please guide should ..

thanks

select tasktemplates.*,task.* tasktemplates         right join task on task.templateid = tasktemplates.id           1=1         , (templateid = #val(k)# or task.id = #val(k)#)  

try it-

select tasktemplates.*,task.*  tasktemplates  left join task b  on b.templateid = a.id 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -