I had a problem with some code last week, which Mike Lacey resolved for me - very kind. Unfortunately, this doesn't seem to be an end to my problem. I now need to display all units irrespective of whether there is an entry for make or drivesize. Does anyone know of a way to do this? This is part of my code as it stands at the moment.
select distinct u.area,u.unitid,u.name,lrundate,tbl_A.Make,tbl_X.Drivesize
from unit u,
(select distinct u.unitid,itval as Make
from unit u right outer join infotxt txt on u.unitid=txt.unitid
where itnameid = '2026')tbl_A,
(select u.unitid,sum(cast(dbl.itval as numeric))as DriveSize from unit u
left outer join infodbl dbl on u.unitid=dbl.unitid
inner join infoname inf on dbl.itnameid = inf.itnameid
where type = 1
and inf.itname like 'drive [a-z]: size%'
and u.area like '%ntserver%'
group by u.unitid)tbl_X
where u.type = '1'
and u.area like '%ntserver%'
and u.unitid = tbl_A.unitid
and u.unitid = tbl_X.unitid
order by u.unitid,tbl_A.Make
If someone could give me a clue it may prevent a nervous breakdown.
Thankyou in advance
Sarah
select distinct u.area,u.unitid,u.name,lrundate,tbl_A.Make,tbl_X.Drivesize
from unit u,
(select distinct u.unitid,itval as Make
from unit u right outer join infotxt txt on u.unitid=txt.unitid
where itnameid = '2026')tbl_A,
(select u.unitid,sum(cast(dbl.itval as numeric))as DriveSize from unit u
left outer join infodbl dbl on u.unitid=dbl.unitid
inner join infoname inf on dbl.itnameid = inf.itnameid
where type = 1
and inf.itname like 'drive [a-z]: size%'
and u.area like '%ntserver%'
group by u.unitid)tbl_X
where u.type = '1'
and u.area like '%ntserver%'
and u.unitid = tbl_A.unitid
and u.unitid = tbl_X.unitid
order by u.unitid,tbl_A.Make
If someone could give me a clue it may prevent a nervous breakdown.
Thankyou in advance
Sarah