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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -