Versions des environnements
Network:
Windows 2003 Server
Roy,
That is correct. You have to use desc when getting the previous row. Also, I got burned by doing this on a list of names when there was multiple names the same. It will skip all the same names and to the next one that is different. Good luck.
>Thanks for the responses,
>
>James, I also tried that and worked pretty good for the "next" but for "previous" I was having some problems but you just gave me a good idea using the asc. For example for the previous I had tried.
>
>select top 1 * from mytable where mycolumn < 'last_col_value'
>
>But obviously it grabs the very first record but if I change the asc/desc order to what I want I probably can get the previous record. Let me try it, thanks!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement