Re: query question for sql experts
Posted in 1998
select EmpID, GroupID, CrDate
from table_name
order by EmpId, CrDate desc
Hope that helps!
Serafim Fonseca
}
} Hi, SQL experts,
}
} Your help on the following qestion will be much appreciated.
} For example:
}
} TableA contains:
}
} EmpID GroupID CrDate
} 22 4 1/20/98
} 24 3 1/19/98
} 25 4 1/18/98
} 25 6 1/17/98
} 24 5 1/16/98
} 22 3 1/15/98
}
} how do I get a query output like the following with pure SQL code:
} (Group by EmpID and order by the lastest crdate first within each EmpID)
}
} EmpID GroupID CrDate
} 22 4 1/20/98
} 22 3 1/15/98
} 24 3 1/19/98
} 24 5 1/16/98
} 25 4 1/18/98
} 25 6 1/17/98
} --
} =-=-=-=-=-=-=-=-=-=-=
} Leslie Tseng
} lesliet@writeme.com
} =-=-=-=-=-=-=-=-=-=-=
}
==========================================================================
Serafim Fonseca e-mail: sf@growela.pt
Growela Portuguesa Calcado, Lda. phone : +351 2 9866300
S. Pedro Avioso, Castelo fax : +351 2 9812212
4470 Maia - PORTUGAL