Database Headaches

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sai26
    New Member
    • Feb 2008
    • 10

    Database Headaches

    Hi everyone,

    I have a situation where my query is structured in such a way as to get
    20 records from top every time...somethin g like
    ---------
    select * from abc order by pkId asc limit lowerLimit,high erLimit
    --------
    so now if i have 2 get the last 20 records..how ?

    can any 1 help me out?
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Based on your example provided
    [CODE=mysql]select * from abc order by pkId DESC limit 20[/CODE]

    Comment

    • sai26
      New Member
      • Feb 2008
      • 10

      #3
      Originally posted by mwasif
      Based on your example provided
      [CODE=mysql]select * from abc order by pkId DESC limit 20[/CODE]

      heyyyy thats ok when u have access to database queries but....hmmm
      i am given a query with the above situation..
      i.e query already sorted in asc. so any solution 2 access last 20 records ?

      Comment

      Working...