Hi
TABLE1
Asset_id
Asset_name
Type_id
TABLE2
Type_id
Type_name
I need a query to use the two tables but exclude the type_id details, for example
SELECT table1.asset_id, table1.asset_name, table2.type_name
FROM table1, table2
Where table1.type_id = table2.type_id
It gets tricky becuase i use a search field to form a dynamic query. The search field allows a user to enter a type_name but type_name is not in table1 so it searches table2. The problem i get is that if it finds a match in table2 it prints the results but i only want to print the result if the type_id is used in table1 (i.eTABLE1 asset_id =1, asset_name= packaging, type_id = 2) (TABLE2 type_id=2, type_name = MEDIUM).
This database is an inventory database so table2 consists of box types (i.e big, small, medium etc) so when i run a query for all medium boxes in stock i want it to print only the medium boxes in table1. But ignores the condition i awant in place.
Thanks