cancel
Showing results for 
Search instead for 
Did you mean: 

Group by clause

former_member226419
Contributor
0 Kudos

Hi,

First of all pardon me for this silly query.

I am getting some strange output.

Input:

COL1COl2MATNR
TECH111A11111MATERAL1
TECH111 A11112MATERAL2
TECH111A11112MATERAL3
TECH111A11113MATERAL4
TECH111A11113MATERAL5
TECH112A11114MATERAL6
TECH112A11115MATERAL7
TECH112A11116MATERAL8

Query:

select "COL1",max("COl2") from "BEST"."matnr_count"

group by "COL1";

Expected Output:

COL1               COL2    

TECH111         A11113

TECH112         A11116

Output Coming:

COL1               COL2

TECH111          A11113

TECH111          A11112

TECH112          A11116



BR

Sumeet

Accepted Solutions (0)

Answers (1)

Answers (1)

sreehari_vpillai
Active Contributor
0 Kudos

I Suspect the data 'TECH111' . Are you sure there is no space in both sides of the text? Re check the data once. And , if still issue persist , delete the records 'A1113' ( 2 rows) and re insert it. Then have a try ( all these steps just because i doubt the data )

Execute the below and check it.

select COL1 , LENGTH(COL1) from <.......>;

Sree