Results 1 to 5 of 5
  1. #1
    asai is offline Senior Member
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    115
    Rep Power
    0

    Default The last post in a SQL table

    Hi,

    Is there a way you can define select to get the last post in a MySQL table?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: The last post in a SQL table

    What does your question have to do with Java?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    asai is offline Senior Member
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    115
    Rep Power
    0

    Default Re: The last post in a SQL table

    I found a command to do this:
    Java Code:
    SELECT * from Table order by ID desc limit 1
    The command is used in a Java program.

    In the same program I want to create lines in a temporary table. When I press a button all theese lines will be transferred to another permanent table, and the lines in the temporary table will be deleted.

    Any suggestions how to do this from my Java program?

  4. #4
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default Re: The last post in a SQL table

    I think you dont need two tables for that, you can add a field which will identify if that record is temporary or permanent. Like zero(0) as temporary and one(1) as permanent.

  5. #5
    asai is offline Senior Member
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    115
    Rep Power
    0

    Default Re: The last post in a SQL table

    Very good idea. I will try this.
    Thanks.

Similar Threads

  1. Replies: 3
    Last Post: 02-23-2012, 09:30 AM
  2. Replies: 1
    Last Post: 09-27-2011, 06:06 AM
  3. Replies: 1
    Last Post: 01-08-2010, 06:19 AM
  4. Replies: 3
    Last Post: 05-04-2009, 03:15 AM

Posting Permissions

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