hello,
I have written following query to retrive the values
select a.Comp_name,b.desig_name,c.Ind_name,d.Function_name from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d where a.Company_id=1 and b.desig_id=778 and Industry_id=147 and Function_id=1;
when i execute this query i am getting following result
Comp_name |Desig_name |Ind_name| Function_name
Microsoft | Manager| IT | Programming
i want to write such query when i give any id value as 0 then it should return me blank record for that perticular id , means as follows
select a.Comp_name,b.desig_name,c.Ind_name,d.Function_name from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d where a.Company_id=0 and b.desig_id=778 and Industry_id=147 and Function_id=0;
Comp_name Desig_name Ind_name Function_name
|Manager | IT|
(above is Required output)
as i am using and operator the condition is not fulfilling because id 0 is not in table. i ve also used or operator but it is giving me all possible combinations.
so please any body tell me query so that i will get only one record as i required.
Ajay
I have written following query to retrive the values
select a.Comp_name,b.desig_name,c.Ind_name,d.Function_name from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d where a.Company_id=1 and b.desig_id=778 and Industry_id=147 and Function_id=1;
when i execute this query i am getting following result
Comp_name |Desig_name |Ind_name| Function_name
Microsoft | Manager| IT | Programming
i want to write such query when i give any id value as 0 then it should return me blank record for that perticular id , means as follows
select a.Comp_name,b.desig_name,c.Ind_name,d.Function_name from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d where a.Company_id=0 and b.desig_id=778 and Industry_id=147 and Function_id=0;
Comp_name Desig_name Ind_name Function_name
|Manager | IT|
(above is Required output)
as i am using and operator the condition is not fulfilling because id 0 is not in table. i ve also used or operator but it is giving me all possible combinations.
so please any body tell me query so that i will get only one record as i required.
Ajay