Hi, What about using SQL views? Thanks. Andrew. Andrew Hodgson Senior Systems Administrator/Projects Engineer Direct Line Tel: 01432 852332 Email: andrew.hodgson@allpay.net Please do not print this email unless absolutely necessary. -----Original Message----- From: blind-sysadmins-bounces@lists.hodgsonfamily.org [mailto:blind-sysadmins-bounces@lists.hodgsonfamily.org] On Behalf Of Greg B. Sent: 10 September 2009 12:02 To: 'Blind sysadmins list' Subject: Re: [Blind-sysadmins] SQL statement. Darragh, Since you cannot use a join then your nested selects are the way to go but remember if the tables get big the processing could slow down and another unfortunate problem is that maintenance could be very problematic. 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: Thursday, September 10, 2009 4:35 AM To: Blind sysadmins list Cc: 'Blind sysadmins list'; blind-sysadmins-bounces@lists.hodgsonfamily.org Subject: Re: [Blind-sysadmins] SQL statement. Hay Greg, Unfortunately, I cant make any changes to the database. during upgrades of the software, a checksum is validated. Regards Darragh Ó Héiligh Members Service desk Offices of the Houses of the Oireachtas, Fredrick Building, South Fredrick Street, Dublin2 Telephone: +353 (1) 618 4444 Email: darragh.oheiligh@oireachtas.ie Internet: http://www.oireachtas.ie "Greg B." <gbobo@woh.rr.com> Sent by: blind-sysadmins-bounces@lists.hodgsonfamily.org 09/09/2009 23:03 Please respond to Blind sysadmins list <blind-sysadmins@lists.hodgsonfamily.org> To "'Blind sysadmins list'" <blind-sysadmins@lists.hodgsonfamily.org> cc Subject Re: [Blind-sysadmins] SQL statement. 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 _______________________________________________ Blind-sysadmins mailing list Blind-sysadmins@lists.hodgsonfamily.org http://lists.hodgsonfamily.org/mailman/listinfo/blind-sysadmins _______________________________________________ Blind-sysadmins mailing list Blind-sysadmins@lists.hodgsonfamily.org http://lists.hodgsonfamily.org/mailman/listinfo/blind-sysadmins _______________________________________________ Blind-sysadmins mailing list Blind-sysadmins@lists.hodgsonfamily.org http://lists.hodgsonfamily.org/mailman/listinfo/blind-sysadmins -- allpay achieved PCI DSS and ISO 27001 certification in 2008 Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88. Telephone: 0844 225 5729, Fax: 0844 557 8350. Website: www.allpay.net Email: enquiries@allpay.net This email, and any files transmitted with it, is confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this email in error please notify the allpay Information Security Manager at the number above.