Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Red face SQL Newbie Needs Help

Status
Not open for further replies.

tux242

IS-IT--Management
Sep 30, 2003
5
US
tux242 is on a distinguished road

Red face SQL Newbie Needs Help
Hiya,

Any help here is greatly appreciated. I'm weak at sql at best, is there an except this domain, being the yellow domain in the statement below, part that you could assist with please, the FROM occupancy where node_name in (select node_name from nodes where domain_name<>'YELLOW') part works in the sql statement I have listed below. The on elisted does space in GB total and number of files on disk/tape total to my knowledge. I now need to include or a statement for Gb per day backed up.


SELECT node_name,CAST(FLOAT(SUM(physical_mb)) / 1024 AS DEC(8,2))as "Space in GB",SUM(num_files)as"Number of files" FROM occupancy where node_name in (select node_name from nodes where domain_name<>'YELLOW') GROUP BY node_name

Thanks. Tux242.
 
Try this:

SELECT entity AS "Node name", CAST(sum(bytes/1024/1024/1024) AS decimal(8,2)) AS "GB xfer",SUBSTR (CAST(min (start_time) AS char(29)),1,10) AS "start date",SUBSTR (CAST(min (start_time) AS char(29)),12,8) AS "start time",SUBSTR (CAST(max (end_time) AS char(29)),1,10) AS "end date",SUBSTR (CAST(max (end_time) AS char(29)),12,8) AS "end time" FROM summary WHERE entity in (select node_name from nodes where domain_name<>'YELLOW' and activity='BACKUP' AND start_time>=current_timestamp - 24 hours GROUP BY entity
 
I get an error 3 code when I run it something about its missing some parts if I remember. This is similar to what I was fighting with befre syntax the durn syntax of it. Any clues. Thanks. Tux242.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top