Query this

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • YoBro

    #1

    Query this

    Is this possible!

    I have a table of vehicles, there is a field called status. When a vehicle
    is sold its status = sold and a field called date_sold also ends up with a
    PHP timestamp in it, so I know when it was sold.

    I only out put on screen the last 40 vehicles sold (in a photo gallery).
    This is easy using LIMIT, order By date_sold DESC etc.

    But what I want to is with all the vehicles that have been sold, that no
    longer appear in the gallery, I need to alter their data.

    How do I run a query to get all sold vehicles less the last 40 sold?

    I hope that makes sense.

    YoBro


  • Peter

    #2
    Re: Query this

    Use the same query but change the limit clause to LIMIT 40, -1


    "YoBro" <yobro@wazzup.c o.nz> wrote in message
    news:5WN_c.2224 2$N77.967331@ne ws.xtra.co.nz.. .[color=blue]
    > Is this possible!
    >
    > I have a table of vehicles, there is a field called status. When a vehicle
    > is sold its status = sold and a field called date_sold also ends up with a
    > PHP timestamp in it, so I know when it was sold.
    >
    > I only out put on screen the last 40 vehicles sold (in a photo gallery).
    > This is easy using LIMIT, order By date_sold DESC etc.
    >
    > But what I want to is with all the vehicles that have been sold, that no
    > longer appear in the gallery, I need to alter their data.
    >
    > How do I run a query to get all sold vehicles less the last 40 sold?
    >
    > I hope that makes sense.
    >
    > YoBro
    >
    >[/color]


    Comment

    • YoBro

      #3
      Re: Query this

      Thanks!
      I new it had to be something as simple as that.

      "Peter" <hernando.patin o@comcast.net> wrote in message
      news:KcidnYSyZY e3aabcRVn-vA@comcast.com. ..[color=blue]
      > Use the same query but change the limit clause to LIMIT 40, -1
      >
      >
      > "YoBro" <yobro@wazzup.c o.nz> wrote in message
      > news:5WN_c.2224 2$N77.967331@ne ws.xtra.co.nz.. .[color=green]
      >> Is this possible!
      >>
      >> I have a table of vehicles, there is a field called status. When a
      >> vehicle
      >> is sold its status = sold and a field called date_sold also ends up with
      >> a
      >> PHP timestamp in it, so I know when it was sold.
      >>
      >> I only out put on screen the last 40 vehicles sold (in a photo gallery).
      >> This is easy using LIMIT, order By date_sold DESC etc.
      >>
      >> But what I want to is with all the vehicles that have been sold, that no
      >> longer appear in the gallery, I need to alter their data.
      >>
      >> How do I run a query to get all sold vehicles less the last 40 sold?
      >>
      >> I hope that makes sense.
      >>
      >> YoBro
      >>
      >>[/color]
      >
      >[/color]


      Comment

      Working...