Click here to Skip to main content
16,014,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 5 departments, and the database is of foll structure

ID department employeename

d1-1 abc aaaaa
d1-2 abc aaaaswdeded
d1-3 abc ewdwcvcd

d2-1 xyz cwecfewfd
d2-1 xyz dewddd
d2-3 xyz fdwedwe

d3-1 ccc dddwq
d3-2 ccc ddwed

d4-1 wq cwewq


i want to display the last id of department when department is selected from drop down list
Posted

1 solution

Hi,

You can use the following query to get the last row


C++
SELECT Top 1 id FROM table_department WHERE departmet='abc' ORDER BY id  desc
 
Share this answer
 
Comments
Db issues 29-Jul-11 2:37am    
Thanks Taj

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900