Okay, say i have a table with the field “code”. The query select code from mytable group by code returns:
code
EM010
EM100
EM101
EM105
EM106
...
I need to add a column (with a join or something) that will contain the next highest code. The above would turn to:
code code2
EM010 null (or blank or wtvr)
EM100 EM010
EM101 EM100
EM105 EM101
EM106 EM105
... ...
I’d provide what I’ve tried but it’s messy and I keep realizing I’m going about it the wrong way.
btw, i’m working in vfp so it’s technically tsql but i should be able to convert anything that’s different, so i don’t mind if i get answers that haven’t been tested in tsql.
Try