Fix Query Display Row With The Last ID With SQL Server 2000 -
i have row table :
id eq ti le val no ================================== 1504 tx 410413 y 2065000 1 1504 tx 410413 y 2065000 2 1504 tx 410413 y 2065000 3 1504 tx 410413 y 730000 4 1504 tx 410413 c 2606900 5 1504 tx 410413 y 4120900 6 1504 tx 410413 y 4120900 7 1504 tx 410413 y 2065000 8 1504 tx 410413 y 2065000 9 1503 tx 410413 y 2065000 1 1503 tx 410413 y 2065000 2 1503 tx 410413 y 2065000 3 1503 tx 410413 y 2065000 4 1503 tx 410413 c 2606900 5 1503 tx 410413 y 4120900 6 1503 tx 410413 y 4120900 7 1503 tx 410413 y 2065000 8 1503 tx 410413 y 2065000 9
what want ask is, how display rows latest id (1504). situation dont know latest id so, query select * ... id '1504' not want use.
please give me advice query how solve this.
try
select * yourtable id=(select max(id) yourtable)
you can use in if want display multiple ids.
Comments
Post a Comment