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

REGARDING SELECT STATEMENT

Former Member
0 Likes
415

HI champions,

i m facing problem in this select statement........its giving error...plz help me.

here im giving the complete scenario....

REPORT ZW.

tablEs:sbook.

select carrid connid count( * ) SUM( LUGGWEIGHT ) INTO (CARRID,CONNID,COUNT,SUM_WEIGHT) FROM SBOOK WHERE CARRID = 'LH' GROUP BY CARRID CONNID HAVING SUM( LUGGWEIGHT ) > 25.

WRITE:/ CARRID,CONNID,COUNT,SUM_WEIGHT.

ENDSELECT.

1 ACCEPTED SOLUTION
Read only

srinivas_akiri
Active Participant
0 Likes
389

Hi ravi,

use need to use the table name as qualifier, here is the corrected code

tablEs: sbook.

data: count type i,

sum_weight type i.

select carrid connid count( * ) SUM( LUGGWEIGHT )

FROM SBOOK

INTO (SBOOK-CARRID, SBOOK-CONNID, COUNT, SUM_WEIGHT)

WHERE CARRID = 'LH'

GROUP BY CARRID CONNID

HAVING SUM( LUGGWEIGHT ) > 25.

WRITE:/ SBOOK-CARRID, SBOOK-CONNID, COUNT, SUM_WEIGHT.

ENDSELECT.

Thanks

Srini

2 REPLIES 2
Read only

Former Member
0 Likes
389

Hello Ravi,

Can you also please give the text of the error ?

Avisesh.

Read only

srinivas_akiri
Active Participant
0 Likes
390

Hi ravi,

use need to use the table name as qualifier, here is the corrected code

tablEs: sbook.

data: count type i,

sum_weight type i.

select carrid connid count( * ) SUM( LUGGWEIGHT )

FROM SBOOK

INTO (SBOOK-CARRID, SBOOK-CONNID, COUNT, SUM_WEIGHT)

WHERE CARRID = 'LH'

GROUP BY CARRID CONNID

HAVING SUM( LUGGWEIGHT ) > 25.

WRITE:/ SBOOK-CARRID, SBOOK-CONNID, COUNT, SUM_WEIGHT.

ENDSELECT.

Thanks

Srini