I have a table with the below data
| route | abnum | knanf | knend |
|---|---|---|---|
| 00012 | 1 | PI | SY |
| 00012 | 2 | SY | PA |
| 00012 | 3 | PA | HN |
and the query
select knanf as start, knend as end from TVRAB as a
where route = '00012' and
( abnum = ( select min( ABNUM ) from TVRAB where route = a~route ) or
abnum = ( select max( ABNUM ) from TVRAB where route = a~route ) )
The results are 2 lines
| START | END |
|---|---|
| PI | SY |
| PA | HN |
Can we have in 1 line the MIN KNANF and the MAX KNEND e.g.
| START | END |
|---|---|
| PI | HN |
Thanks
Below query produces the output you are looking for.