AnsweredAssumed Answered

Help with SQL Query

Question asked by ma12 on Oct 1, 2015
Latest reply on Oct 5, 2015 by ma12

Greetings,

 

I am trying to create a process for updating custom Primary skill field from OOB skill values for a particular parent. As a user can have multiple skills i have to select 1 skill. I was able to get the process working when i select 1 resource but not able to update for all resources.

 

Below is the query when I select  1 ressource it works.

 

update

odf_ca_resource odf SET si_primary_skill =

  (select rsa.skill_id

  from  rsm_skills_associations rsa,rsm_skills rs

  where rs.parent_skill_id = '5001061'

  and  rsa.skill_id = rs.id

  and rsa.object_id = '5555003'

  and  ROWNUM <=1)

  WHERE odf.si_primary_skill IS NULL

  and odf.id = '5555003'

 

Below is query that I am trying to use update for all resources. There is one basic sql query statement i am missing but not able to point it.

 

update

  odf_ca_resource odf SET si_primary_skill =

  (select rsa.skill_id

  from  rsm_skills_associations rsa,rsm_skills rs

  where rs.parent_skill_id = '5001061'

  and  rsa.skill_id = rs.id

  and  ROWNUM <=1)

  WHERE odf.si_primary_skill IS NULL

  and odf.id = rsm_skills_associations.object_id

 

 

Thanks,

Ma

Outcomes