Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2014
    Posts
    4

    Unanswered: Update Command with ORDER BY DESC LIMIT 0,1

    hi All,

    Iwant to write a query that is Update Command with ORDER BY DESC LIMIT 0,1
    I wrote like this
    Update tblattendance set OutTime='2014-07-19 05:47:00 ' where CardId='0005638348' ORDER BY DateOfTransaction DESC LIMIT 0,1;

    I am getting Error ,
    Please Help me

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    In MySQL, the UPDATE statement syntax only permits a rowcount for the LIMIT clause. What does "0, 1" mean to you?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jul 2014
    Posts
    4
    I want Last inserted row of table where CardId='0005638348' .How can i retrive it

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    What column or condition in the table defines the "last" row for you? Based on the syntax you presented, it can't be the OutTime column.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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