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

select stm

Former Member
0 Likes
931

SELECT clifnr MAX( beindt )

SUM( b~menge ) ...........

what does this mean?

plz explain me

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
897

MAX( b~eindt ) - it will get latest date data from database table

SUM - it will calulate the all the values qty,in thi condition you need to add group by .

Message was edited by:

Seshu Maramreddy

8 REPLIES 8
Read only

Former Member
0 Likes
897

Hi,

1. It means that

2. From the table, there must be field lifnr,

3. So based on lifnr / grouped by lifnr,

fetch some numeric values,

4. In that,

against each lifnr,

we will get 2 numeric values

a) Maximum of eindt field

b) sum of menge field

regards,

amit m.

Read only

0 Likes
897

the problem is i didnt got that MAX and SUM ?

What it will give

Read only

0 Likes
897

Hi again,

1. Max and sum are called aggregate values.

2. Suppose we have

lifnr field 1 fiedl2

1 50 45

1 60 100

2 30 10

then for lifnr=1

Max (Maximum) will be 60

Sum (Total) will be 110

Similary for lifnr = 2

Max (Maximum) will be 30

Sum (Total) will be 10

regards,

amit m.

Read only

Former Member
0 Likes
898

MAX( b~eindt ) - it will get latest date data from database table

SUM - it will calulate the all the values qty,in thi condition you need to add group by .

Message was edited by:

Seshu Maramreddy

Read only

Former Member
0 Likes
897

Hi

You r selecting lifnr from one table for which u have given alias name as 'C', maximum number of eindt this field from a different table and you are summing up the quantity (menge).

Regards

Haritha.

Read only

Former Member
0 Likes
897

This syntax is used when you have join on multiple tables. To differentiate the

fields from different tables, tables are aliased .

Read only

Former Member
0 Likes
897

it will sum all menge by SUM,

and the latest date is got by MAX,

regards

prabhu

Read only

Former Member
0 Likes
897

well it will select you the lifnr, the max of eindt and the sum of menge.

Tho its not too clever to sum wher you in first hand do a MAX. Since a MAX will get you ONE record only always.

the "~" symbol secifies that the select will be done down do the DB tables, not using an buffers or chaches or transparent tables.