Click here to Skip to main content
15,850,299 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have created table and inserted record but in join query showing error.

What I have tried:

select gi.group_members as ID, em.EMP_NAME as NAME, em.EMAIL_ID as EMAIL , v.DIR_MOBILE
from groupinfo gi 
join emp_master em on gi.group_members= '3'|| EMP_NO || '0' 
join V_EMP_MOBILE v on v.DIR_EMP_NO='3'|| EMP_NO || '0'
and group_name='oper';
Posted
Updated 10-Oct-18 3:42am
Comments
CHill60 10-Oct-18 7:17am    
What error?
What happens if you query the table directly?
jsc42 10-Oct-18 8:06am    
As @CHill60 says, What error?

There are a million and one possible error each with different causes.

My wide guess is that you have fields EMP_NO and / or group_name present in multiple tables so Oracle doesn't know which one to use. Try using qualified names, e.g. em.EMP_NO and gi.group_name (if they are in emp_master and groupinfo respectively, otherwise adjust as required).
Or is EMP_NO numeric? In which case you may need to cast / convert to text if gi.group_members and v.DIR_EMP_NO are texts; otherwise if they are all numbers, convert the concatenated string expressions to arithmetic expressions (exact formula depends on whether EMP_NO has a constant no of digits excluding leading zeros or not).

In summary ... please supply more information as we cannot guess exactly what you arte trying to do.

I'll leave it to someone else to comment on using expressions rather than simple column names in join clauses.

1 solution

Check out this: Oracle / PLSQL: ORA-00942 Error Message[^]
There you'll find few options how to resolve this issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900