Darragh, Just taking a quick look a the situation, couldn't you do a inner join on these tables which would serve to merge the information, of course that would make the select a little more complicated but as long as the tables aren't huge it should be able to be done or do you think I am "barking up the wrong tree". Greg B. -----Original Message----- From: blind-sysadmins-bounces@lists.hodgsonfamily.org [mailto:blind-sysadmins-bounces@lists.hodgsonfamily.org] On Behalf Of Darragh.OHeiligh@Oireachtas.ie Sent: Tuesday, September 08, 2009 6:57 AM To: Blind sysadmins list Subject: [Blind-sysadmins] SQL statement. Hello, I'm kind of hitting a mental block with an SQL statement. I think I'll be restricted to only uisng one statement to accomplish this goal. I have four pieces of information in four tables. I need to merge all this information into one report. This is for a call management system that I'm in the process of installing. the tables are incidents incident-assets assets asset types. Assets are assigned to a type. for example. all the gx 745's will be assigned to the workstation type. I need the tool to be able to report on the number of incidents per asset type. here's a really high overview of the colums in each table. assets id, name, model and type. asset types type-id type-name incidents incident id. incident-assets incident-id and asset-id so, I have the incident and the asset id in the same table. Sorry, this next bit is as much for my thought process as it is to be descriptive. If I used nested select statements, could I select * from incidents and order by incident_assets my problem is I need to get information out of two different tables to complete the output. In english, it would have to be select everything from incidents where the incident.id field was the same as the id field in the incident-assets table. we'd then need to count the incidents that had been assigned to each type. Finally, we'd assign the name to that type. If I can dump this information out in some format that I can throw into EXCEL I may be able to do something with it in terms of compiling it into a report. Sorry. that was really long winded but my brain is fried thinking about it. _______________________________________________ Blind-sysadmins mailing list Blind-sysadmins@lists.hodgsonfamily.org http://lists.hodgsonfamily.org/mailman/listinfo/blind-sysadmins