Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with nested select

Former Member
0 Likes
477

I have a problem setting select structure to calculate the total days from a table .The problem is like that:

I have 2 tables first of which contains 'days' and 'objnr3' fields.objnr3 contains the id's of elements with stufe = 3.

The latter table contains 'objnr2' and 'objnr3' fields but not 'days' and I want to calculate the total days spent on the jobs with stufe = 2 using SELECT SUM(days)....

What should I do to have it calculated?

Edit : The latter table is an internal table, not an SQL one and this makes the problem complicated for a beginner .

Thanks in advance..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
452

HI

First make a loop on inetrnal table and store all entries with stufe = 2 on another internal table.

neaxt make select query of DB table using all entries and then sum up the days.

Aditya

2 REPLIES 2
Read only

Former Member
0 Likes
453

HI

First make a loop on inetrnal table and store all entries with stufe = 2 on another internal table.

neaxt make select query of DB table using all entries and then sum up the days.

Aditya

Read only

Former Member
0 Likes
452

Hi Andy,

Write query like this

SELECT SUM(days) as days objnr2 objnr3........................

Check this,

Regards,

Santosh Kumar M.