Results 1 to 2 of 2

Thread: Jdbc

  1. #1
    KumbhaniMehul is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default Jdbc

    I hava one Item_Details Table.I want to move directly on the last record and i want to get the value of the first colume.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    If you want to find the last row in a table in a DB which has a IDENTITY column which named as ID then use the following.

    SELECT * FROM TABLE WHERE ID = (SELECT MAX(ID) FROM TABLE)
    Or else you can use TOP 1 on the table with ordered data in descending order.

    Is that you want to know?

Similar Threads

  1. Jdbc
    By HariPrasad in forum JDBC
    Replies: 1
    Last Post: 07-30-2009, 06:07 AM
  2. JDBC for DB2
    By mostafa-sky in forum JDBC
    Replies: 1
    Last Post: 03-21-2009, 06:17 PM
  3. Replies: 0
    Last Post: 04-01-2008, 11:17 AM
  4. Replies: 0
    Last Post: 09-28-2007, 01:56 PM
  5. Ha-jdbc 2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-17-2007, 06:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •