Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.
kwikwisi Constraint Violating Yak Guru
283 Posts
visakh16 Very Important crosS Applying yaK Herder
52326 Posts
quote:Originally posted by visakh16SELECT reqdcolFROM TableWHERE PK=(SELECT MAX(PK) FROM Table) PK is the primary key
quote:Originally posted by kwikwisiPk means primary key,right?i want last column field(which is pk)quote:Originally posted by visakh16SELECT reqdcolFROM TableWHERE PK=(SELECT MAX(PK) FROM Table) PK is the primary keythen simply useSELECT max(pk) from table
madhivanan Premature Yak Congratulator
22864 Posts
quote:Originally posted by kwikwisihow can i get specific column of last row.eg.last customerid of table customer
quote:Originally posted by madhivananquote:Originally posted by kwikwisihow can i get specific column of last row.eg.last customerid of table customerThere is no last or first row until you specify what it is MadhivananFailing to plan is Planning to fail
quote:Originally posted by visakh16quote:Originally posted by madhivananquote:Originally posted by kwikwisihow can i get specific column of last row.eg.last customerid of table customerThere is no last or first row until you specify what it is MadhivananFailing to plan is Planning to failI think he meant last inserted customer id
quote:Originally posted by madhivananquote:Originally posted by visakh16quote:Originally posted by madhivananquote:Originally posted by kwikwisihow can i get specific column of last row.eg.last customerid of table customerThere is no last or first row until you specify what it is MadhivananFailing to plan is Planning to failI think he meant last inserted customer id There is no way to identify this if the values are not sequential MadhivananFailing to plan is Planning to fail
SQLTeam.com Articles via RSS
SQLTeam.com Weblog via RSS
- Advertisement -
Articles
Forums
Blogs
Contact Us
About the Site