Last post Feb 24, 2011 08:01 PM by Lannie
Feb 23, 2011 09:51 AM|raamvar|LINK
i need to get data from 3 tables,
i have 3 tables tpackage,tinfodts,ttemp i have used below query to get the info but it didn't work
fields are tpackage(paquete,spaquete,date) tinfodts(paquete.vobjtype),ttemp(paquete)
select tpackage.paquete as packagename,tpackage.spaquete as volume,(select count(*) from tinfodts where paquete = tpackage.paquete) as reference[here if value is null then i need to get the data from ttemp as(select count(*) from ttemp where paquete = tpackage.paquete)
as nbreference,(select vobjtype from tinfodts where paquete = tpackage.paquete) where rownum = 1 as format from tpackage inner join tinfodts inner join ttemp on tpackage.paquete = tinfodts.paquete,tpackage.paquete = ttemp.paquete where date = always yesterday.
I am new to oracle, please can anyone suggest right query to get the result.
Result i need is (packagename,volume(count from tinfodts where paquete = tpackage.paquete = 0 then count of ttemp),format(is first row of field vobjtype from tinfodts table) where date = always yesterday.
Feb 24, 2011 08:01 PM|Lannie|LINK
I can help you, the query did not work because it has errors in SQL logic.
but let's eliminate some of the noise first.
Give us your three table definitions,
In Oracle at SQL prompt type
SQL> DESC tpackage
SQL> DESC tinfodts
SQL> DESC ttemp
Then we can build the query piecce by piece to get the results you need.