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

max in select statement

Former Member
0 Likes
474

Hi,

I need to get the maximum number for a fiekld from a table...

like

I have a table as ZType

in that i have fields as

Empid Name

1 S

2 V

3 A

I need the maximum of the empid...

That is 3...

How to do this in select statement.

3 REPLIES 3
Read only

Former Member
0 Likes
431

HI,

Try

   select max(empid) into v_empid
   frrom table_name.

Regards

Arun

Read only

Former Member
0 Likes
431

Solved

Read only

Former Member
0 Likes
431

Hello,

U can do like.

Select * from ztable into itab.

sort itab by empid descending.

read table itab index 1.

or select max(empid) into v_empid

frrom ztable.

If useful reward.

Vasanth