I don't think you can do it in a single command. You will need some programming to do this.
For instance, get all the possible values for "upcode", and then write a loop to add the field names (upcode_V, upcode_S, ...) to a query statement. Then, execute the query statement with macro substitution.
HTH,
Hilmar.
BTW, the < PRE > and < /PRE > tags are meant to be used for program code, not for the entire message.
>
>
>
>
>i have this in my table
>
>
>
>empno upcode cnt
>00001 V 2
>00001 S 1
>00001 H 2
>00002 1 1
>00002 3 2
>00003 V 3
>00004 S 5
>00004 N 1
>.
>.
>.
>.
>
>
>
>
>
>i want to select all records with fields empno, V, S, N.. etc.
>
>like i want each upcode to be the fields of my select..
>
>how do i do that?
>
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)