How to use LEAD function??
868814Jul 5 2011 — edited Jul 6 2011hello everyone,
i am new at this; i know only some basic "select" statements like, "select column1, column1, etc. when column1='***' etc...
Today i ran into a more complicated select, and i can't figure it out. Please help. btw, i tried the "LEAD" function but results is not working as i wanted.
I have an EMPLOYEE table of the followings. what i want to 'select' is, if the employee name of the next record is equal to the previous record, then put the TITLE of the next record into a new column(see sample results under "RESULTS") section, AND list results of only those records that the "TITLE" does not equal to "NEW-COLUMN"
thank you.
Joe
_EMPLOYEE TABLE_
NAME TITLE
joe clerk1
joe clerk2
john nurse1
john nurse2
john wilson nurse3
_RESULTS_
NAME TITLE NEW-COLUMN
joe clerk1 clerk2
john nurse1 nurse2