Home » Developer & Programmer » Reports & Discoverer » Sql query
Sql query [message #267481] Thu, 13 September 2007 07:43 Go to next message
dimis283
Messages: 38
Registered: July 2007
Location: greece
Member
I have a table with employees and a view with some informations for them.
I want to make a report with the employees those have
select (emp.dosivalue+emp.dosi2value +emp.dosi3value+)*2 
 from emp

the same as
select  sum(nvl(empv.posovalue,0)) from empv group by emp_id,per_id

The emp_id is the primary key of emp (employees).
How I may do that (to make the query) ?
Dimis
Re: Sql query [message #267567 is a reply to message #267481] Thu, 13 September 2007 13:22 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
If you provide us with create table and insert scripts, we might be able to help you.

Emp and empv are two different tables? Then please also describe the relation between the two.
Re: Sql query [message #267590 is a reply to message #267567] Thu, 13 September 2007 15:55 Go to previous messageGo to next message
dimis283
Messages: 38
Registered: July 2007
Location: greece
Member
empl is the table for employees and there are 7 fields that has the money of a loan that he has to pay.
The sum of those must be the same as the sum(empv.posovalue) from empv for a period (per_id) as the script.
Something that I will test is to compare those sums via report functions and if they are not the same to make the fields of that employee visible at report.
Dimis
Re: Sql query [message #267591 is a reply to message #267590] Thu, 13 September 2007 15:58 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hm?
Re: Sql query [message #267711 is a reply to message #267591] Fri, 14 September 2007 06:09 Go to previous messageGo to next message
skooman
Messages: 912
Registered: March 2005
Location: Netherlands
Senior Member
WHAT? Do you mean that this issue has been around and unsolved since 2005? Wow, there must be a lot of hidden difficulties behind this question...
Well, since there are still no create table nor insert scripts, we'll never know.

Or... the OP doesn't have the strikingly good memory LF has Laughing
Re: Sql query [message #267723 is a reply to message #267711] Fri, 14 September 2007 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
LOL, no ... 2005 is date when he joined dBforums. Question was asked yesterday (can be seen above user's nickname).
Re: Sql query [message #267749 is a reply to message #267481] Fri, 14 September 2007 12:14 Go to previous message
dimis283
Messages: 38
Registered: July 2007
Location: greece
Member
Thank everybody for the interesting, but I solved it as I wrote at both forums...
Dimis
Previous Topic: TWO QUERIES IN REPORT
Next Topic: Image in Oracle Report
Goto Forum:
  


Current Time: Sat Dec 03 08:23:02 CST 2016

Total time taken to generate the page: 0.10491 seconds