hi, i am working on a script that queries database records and then does analysis. records are organized by a certain type, each type is designated by a value 1 - 18.
Once i know a type has records, i have a series of queries that run and kick back analysis. i don't need to know how many times each record type shows up, just whether there is one or more. I know how to check for a value, and could do a brute force where each value is checked and then have an if statement. there must be some other way though plus new types might be added so i cant really hard code it, so to speak.
here is an example:
SELECT table1.name from table1, table2 where table1.typeid=5 and table1.typeid = table2.typeid group by name
the part i am focusing on is: 'where table1.typeid=5'
that needs to be dynamic -- based on the typeid values that exist in a database.... what method should I be looking at?
thanks.