search through sql tables
-
I have a database with 3 tables: pc, printer, scale. All 3 tables have fileds hostname, ip_address and serial_number. I've designed a form to search any of these tables by host, ip and sn. I'm having trouble making the search go through all 3 tables and return if something is found. Like is i search for host "comp" if it's a pc it returns the values from table pc, if it's a printer returns values from table printer. The same for the other fields.
-
I have a database with 3 tables: pc, printer, scale. All 3 tables have fileds hostname, ip_address and serial_number. I've designed a form to search any of these tables by host, ip and sn. I'm having trouble making the search go through all 3 tables and return if something is found. Like is i search for host "comp" if it's a pc it returns the values from table pc, if it's a printer returns values from table printer. The same for the other fields.
Where are you having problems ? It sounds to me like a poor DB design, you probably wanted one table with a column that tells you if it's a PC, a printer, etc. Either way, it sounds like you're saying you can't get the SQL right, which makes this a SQL question. Posting the SQL would sure help us to help you.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )