sql command

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • miladhatam@gmail.com

    #1

    sql command

    hi
    how can i select last 5 fields of my table
    i don't know it sql command

  • Alexey Smirnov

    #2
    Re: sql command

    On May 9, 7:37 pm, "miladha...@gma il.com" <miladha...@gma il.com>
    wrote:
    hi
    how can i select last 5 fields of my table
    i don't know it sql command
    SELECT field6, field7, field8, field9, field10 FROM mytable

    Comment

    • miladhatam@gmail.com

      #3
      Re: sql command

      sorry alexy :)
      oh i made a mistake i want to select 5 last records :)
      sorry ...
      have any idea ?
      thanks

      Comment

      • Alexey Smirnov

        #4
        Re: sql command

        On May 10, 9:01 am, "miladha...@gma il.com" <miladha...@gma il.com>
        wrote:
        sorry alexy :)
        oh i made a mistake i want to select 5 last records :)
        sorry ...
        have any idea ?
        thanks
        SELECT TOP 5 * FROM mytable ORDER BY something DESC

        where "something" is a name of the field which used for a consecutive
        values like rowid, date created, etc...

        Comment

        • Juan T. Llibre

          #5
          Re: sql command

          Is there a date-of-record field ?

          select top 5 * from yourtable order by datefield desc




          Juan T. Llibre, asp.net MVP
          asp.net faq : http://asp.net.do/faq/
          foros de asp.net, en espaƱol : http://asp.net.do/foros/
          =============== =============== =====
          <miladhatam@gma il.comwrote in message
          news:1178780479 .157309.242170@ e65g2000hsc.goo glegroups.com.. .
          sorry alexy :)
          oh i made a mistake i want to select 5 last records :)
          sorry ...
          have any idea ?
          thanks
          >

          Comment

          • miladhatam@gmail.com

            #6
            Re: sql command

            thanks alexey
            like every time you helped me

            Comment

            Working...