I have 3 tables
table_1
function_code
function_desc
table_2
function_code
itemfunction_code
itemfunction_desc
parameter_code
table_3
parameter_code
parameter_desc
class_code
I need to list all functions (code and description - table_1) where the item functions (table_2)
have only parameters with class code = 1
I tried the query bellow but it doesn't work.
SELECT DISTINCT fun.function_desc, fun.function_code
FROM table_1 fun
INNER JOIN table_2 itm
ON fun.function_code = itm.function_code
INNER JOIN table_3 par
ON itm.parameter_code = par.parameter_code
WHERE par.class_code = 1
The query returns all parameters with class code 1 but may return parameters with another classes
Thank you very much.
table_1
function_code
function_desc
table_2
function_code
itemfunction_code
itemfunction_desc
parameter_code
table_3
parameter_code
parameter_desc
class_code
I need to list all functions (code and description - table_1) where the item functions (table_2)
have only parameters with class code = 1
I tried the query bellow but it doesn't work.
SELECT DISTINCT fun.function_desc, fun.function_code
FROM table_1 fun
INNER JOIN table_2 itm
ON fun.function_code = itm.function_code
INNER JOIN table_3 par
ON itm.parameter_code = par.parameter_code
WHERE par.class_code = 1
The query returns all parameters with class code 1 but may return parameters with another classes
Thank you very much.