I printed $avgSQL and got:
SELECT avg(PDH_CSV40_EasternDaylightTime_240_) as PDH_CSV40_EasternDay +lightTime_240_, avg(ERWWCOMMUNITIES_Memory_Pages_sec) as ERWWCOMMUNIT +IES_Memory_Pages_sec, avg(ERWWCOMMUNITIES_NetworkInterface_CompaqEthe +rnet_FastEthernetAdapter_Module_BytesTotalPERsec) as ERWWCOMMUNITIES_ +NetworkInterface_CompaqEthernet_FastEthernetAdapter_Module_BytesTotal +PERsec, avg(ERWWCOMMUNITIES_NetworkInterface_MSTCPLoopbackinterface_B +ytesTotalPERsec) as ERWWCOMMUNITIES_NetworkInterface_MSTCPLoopbackint +erface_BytesTotalPERsec, avg(ERWWCOMMUNITIES_NetworkInterface_CompaqE +thernet_FastEthernetAdapter_Module_CurrentBandwidth) as ERWWCOMMUNITI +ES_NetworkInterface_CompaqEthernet_FastEthernetAdapter_Module_Current +Bandwidth, avg(ERWWCOMMUNITIES_NetworkInterface_MSTCPLoopbackinterfac +e_CurrentBandwidth) as ERWWCOMMUNITIES_NetworkInterface_MSTCPLoopback +interface_CurrentBandwidth, avg(ERWWCOMMUNITIES_PhysicalDisk_0C_PCTDi +skTime) as ERWWCOMMUNITIES_PhysicalDisk_0C_PCTDiskTime, avg(ERWWCOMMU +NITIES_PhysicalDisk_1D_PCTDiskTime) as ERWWCOMMUNITIES_PhysicalDisk_1 +D_PCTDiskTime, avg(ERWWCOMMUNITIES_PhysicalDisk_Total_PCTDiskTime) as + ERWWCOMMUNITIES_PhysicalDisk_Total_PCTDiskTime, avg(ERWWCOMMUNITIES_ +PhysicalDisk_Total_AvgDiskQueueLength) as ERWWCOMMUNITIES_PhysicalDis +k_Total_AvgDiskQueueLength, avg(ERWWCOMMUNITIES_Processor_Total_PCTPr +ocessorTime) as ERWWCOMMUNITIES_Processor_Total_PCTProcessorTime, avg +(ERWWDC1_Memory_PagesPERsec) as ERWWDC1_Memory_PagesPERsec, avg(ERWWD +C1_NetworkInterface_IntelPRO_100NetworkConnection_BytesTotalPERsec) a +s ERWWDC1_NetworkInterface_IntelPRO_100NetworkConnection_BytesTotalPE +Rsec, avg(ERWWDC1_NetworkInterface_MSTCPLoopbackinterface_BytesTotalP +ERsec) as ERWWDC1_NetworkInterface_MSTCPLoopbackinterface_BytesTotalP +ERsec, avg(ERWWDC1_NetworkInterface_IntelPRO_100NetworkConnection_Cur +rentBandwidth) as ERWWDC1_NetworkInterface_IntelPRO_100NetworkConnect +ion_CurrentBandwidth, avg(ERWWDC1_NetworkInterface_MSTCPLoopbackinter +face_CurrentBandwidth) as ERWWDC1_NetworkInterface_MSTCPLoopbackinter +face_CurrentBandwidth, avg(ERWWDC1_PhysicalDisk_0C_PCTDiskTime) as ER +WWDC1_PhysicalDisk_0C_PCTDiskTime, avg(ERWWDC1_PhysicalDisk_Total_PCT +DiskTime) as ERWWDC1_PhysicalDisk_Total_PCTDiskTime, avg(ERWWDC1_Phys +icalDisk_Total_AvgDiskQueueLength) as ERWWDC1_PhysicalDisk_Total_AvgD +iskQueueLength, avg(ERWWDC1_Processor_Total_PCTProcessorTime) as ERWW +DC1_Processor_Total_PCTProcessorTime, avg(ERWWNAB_Memory_PagesPERsec) + as ERWWNAB_Memory_PagesPERsec, avg(ERWWNAB_NetworkInterface_Intel825 +5x_basedIntegratedFastEthernet_BytesTotalPERsec) as ERWWNAB_NetworkIn +terface_Intel8255x_basedIntegratedFastEthernet_BytesTotalPERsec, avg( +ERWWNAB_NetworkInterface_MSTCPLoopbackinterface_BytesTotalPERsec) as +ERWWNAB_NetworkInterface_MSTCPLoopbackinterface_BytesTotalPERsec, avg +(ERWWNAB_NetworkInterface_Intel8255x_basedIntegratedFastEthernet_Curr +entBandwidth) as ERWWNAB_NetworkInterface_Intel8255x_basedIntegratedF +astEthernet_CurrentBandwidth, avg(ERWWNAB_NetworkInterface_MSTCPLoopb +ackinterface_CurrentBandwidth) as ERWWNAB_NetworkInterface_MSTCPLoopb +ackinterface_CurrentBandwidth, avg(ERWWNAB_PhysicalDisk_0C_PCTDiskTim +e) as ERWWNAB_PhysicalDisk_0C_PCTDiskTime, avg(ERWWNAB_PhysicalDisk_T +otal_PCTDiskTime) as ERWWNAB_PhysicalDisk_Total_PCTDiskTime, avg(ERWW +NAB_PhysicalDisk_Total_AvgDiskQueueLength) as ERWWNAB_PhysicalDisk_To +tal_AvgDiskQueueLength, avg(ERWWNAB_Processor_Total_PCTProcessorTime) + as ERWWNAB_Processor_Total_PCTProcessorTime, avg(ERWWSEARCH_Memory_P +agesPERsec) as ERWWSEARCH_Memory_PagesPERsec, avg(ERWWSEARCH_NetworkI +nterface_BroadcomNetXtremeGigabitEthernetDriver_BytesTotalPERsec) as +ERWWSEARCH_NetworkInterface_BroadcomNetXtremeGigabitEthernetDriver_By +tesTotalPERsec, avg(ERWWSEARCH_NetworkInterface_IntelPRO_100NetworkCo +nnection_BytesTotalPERsec) as ERWWSEARCH_NetworkInterface_IntelPRO_10 +0NetworkConnection_BytesTotalPERsec, avg(ERWWSEARCH_NetworkInterface_ +MSTCPLoopbackinterface_BytesTotalPERsec) as ERWWSEARCH_NetworkInterfa +ce_MSTCPLoopbackinterface_BytesTotalPERsec, avg(ERWWSEARCH_NetworkInt +erface_BroadcomNetXtremeGigabitEthernetDriver_CurrentBandwidth) as ER +WWSEARCH_NetworkInterface_BroadcomNetXtremeGigabitEthernetDriver_Curr +entBandwidth, avg(ERWWSEARCH_NetworkInterface_IntelPRO_100NetworkConn +ection_CurrentBandwidth) as ERWWSEARCH_NetworkInterface_IntelPRO_100N +etworkConnection_CurrentBandwidth, avg(ERWWSEARCH_NetworkInterface_MS +TCPLoopbackinterface_CurrentBandwidth) as ERWWSEARCH_NetworkInterface +_MSTCPLoopbackinterface_CurrentBandwidth, avg(ERWWSEARCH_PhysicalDisk +_0CD_PCTDiskTime) as ERWWSEARCH_PhysicalDisk_0CD_PCTDiskTime, avg(ERW +WSEARCH_PhysicalDisk_Total_PCTDiskTime) as ERWWSEARCH_PhysicalDisk_To +tal_PCTDiskTime, avg(ERWWSEARCH_PhysicalDisk_Total_AvgDiskQueueLength +) as ERWWSEARCH_PhysicalDisk_Total_AvgDiskQueueLength, avg(ERWWSEARCH +_Processor_Total_PCTProcessorTime) as ERWWSEARCH_Processor_Total_PCTP +rocessorTime, avg(ERWWSQLWEB_Memory_PagesPERsec) as ERWWSQLWEB_Memory +_PagesPERsec, avg(ERWWSQLWEB_NetworkInterface_BroadcomNetXtremeGigabi +tEthernetDriver_BytesTotalPERsec) as ERWWSQLWEB_NetworkInterface_Broa +dcomNetXtremeGigabitEthernetDriver_BytesTotalPERsec, avg(ERWWSQLWEB_N +etworkInterface_MSTCPLoopbackinterface_BytesTotalPERsec) as ERWWSQLWE +B_NetworkInterface_MSTCPLoopbackinterface_BytesTotalPERsec, avg(ERWWS +QLWEB_NetworkInterface_BroadcomNetXtremeGigabitEthernetDriver_Current +Bandwidth) as ERWWSQLWEB_NetworkInterface_BroadcomNetXtremeGigabitEth +ernetDriver_CurrentBandwidth, avg(ERWWSQLWEB_NetworkInterface_MSTCPLo +opbackinterface_CurrentBandwidth) as ERWWSQLWEB_NetworkInterface_MSTC +PLoopbackinterface_CurrentBandwidth, avg(ERWWSQLWEB_PhysicalDisk_0CD_ +PCTDiskTime) as ERWWSQLWEB_PhysicalDisk_0CD_PCTDiskTime, avg(ERWWSQLW +EB_PhysicalDisk_Total_PCTDiskTime) as ERWWSQLWEB_PhysicalDisk_Total_P +CTDiskTime, avg(ERWWSQLWEB_PhysicalDisk_Total_AvgDiskQueueLength) as +ERWWSQLWEB_PhysicalDisk_Total_AvgDiskQueueLength, avg(ERWWSQLWEB_Proc +essor_Total_PCTProcessorTime) as ERWWSQLWEB_Processor_Total_PCTProces +sorTime FROM results
It looks OK to me, but then again, I'm a novice at SQL.
I do a lot of preprocessing to the csv files before I run them through the perl script. I remove spaces, , , (, ), etc... the list above has all column names in it. I'm wondering if this should be looped? These csv files will average about 30 columns and upto 6000 rows. Doing all the average calculations in one command may be a little taxing on my system.

PS. I don't need the data after the average is calculated. Just the column name and the average. Also, I don't need the first column, that can just go away.

In reply to Re^4: Database processing by DrAxeman
in thread DBI::st=HASH output by DrAxeman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.