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

Selecting max value in character string

Former Member
0 Likes
2,178

Hi Guru's,

I am fetching data from ztable . In this table I have to select GATEEXIT_NO which is dat type charecter . For this I have both numeric values and character value's eixts in table . In this I have to select max value.

Ex : GATEEIXT_NO

NOD-1233

NOD-4566

9011091000

9011091002

If I write select query I have to select max value 9011091002 only . will any body please give solution for this.

Thanks,

Santhosh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,090

Hi Santhosh,

You need to use aggregate functions.

Select max(columname) from ztable into v_variable

group by (all keys).

All Keys - all primary keys should be listed.

HTH.

Best Regards,

Benedict

1 REPLY 1
Read only

Former Member
0 Likes
1,091

Hi Santhosh,

You need to use aggregate functions.

Select max(columname) from ztable into v_variable

group by (all keys).

All Keys - all primary keys should be listed.

HTH.

Best Regards,

Benedict