Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2006
    Posts
    1

    Arrow Unanswered: last 3 records (was "please solve my problem quickly")

    A TABLE CONSIST OF DATA LIKE AS FOLLOWS. HERE WE HAVEN'T DECLARED PRIMARY KEY FOR ANY COLUMN.
    ENO ENAME ------------
    19 AAA
    23 JJJ
    2 RE
    7 HH
    23 JAGAN
    4 MOHAN
    6 NAIDU
    78 JEEVAN

    I WANT LAST 3 RECORDS FROM THIS TABLE USING SELECT COMMAND. I HAVE TRIED FOR THIS ONE LIKE FOLLOWING QUERY

    SELECT TOP 3 * FROM TABLENAME ORDER BY DESC

    IT WILL GIVE THE WRONG RESULT.

    IF U FIND ANSWER IMMEDIATELY SEND TO MY MAIL

    jagan.5583@yahoo.com
    jagan.penikalapati@gmail.com
    geevankumar@gmail.com

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    No RDBMS specified so moved to SQL forum.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    • Press <Caps Lock> once again
    • In relational databases, "last 3 records" must be specified. What do you want your result to be ordered by? If you mean "3 records that were last entered into a table", there's no such thing unless you store another identifier (date and time or a sequence number, for example).

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    TOP specified so moved to Access forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ?? ORDER BY what DESC

    reply by mail (immediately, or otherwise) - is that a joke?

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by izyrider
    ?? ORDER BY what DESC

    reply by mail (immediately, or otherwise) - is that a joke?

    izy
    Like "as if" ... I've seen these posts by these clowns before. I've never sent an answer to that/those email addresses ...


    And I'll echo as previous posters have: The last 3 records IN WHAT ORDER???? By name or by number?
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Aug 2006
    Location
    San Francisco, CA
    Posts
    136
    You always see the users with 1 post make the
    reply by mail (immediately, or otherwise)
    I guess someone didn't do their homework

Posting Permissions

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