Delete first row from column

Discussion in 'MySQL' started by timallard, Oct 1, 2009.

  1. #1
    How can I delete the very first row from a column in php/mysql?

    Thank you,
    -Tim
     
    timallard, Oct 1, 2009 IP
  2. timallard

    timallard Well-Known Member

    Messages:
    1,634
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    158
    #2
    delete from column limit 1?

    This worked but I just want to make sure it is the safest.
     
    timallard, Oct 1, 2009 IP
  3. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Databases are not spreadsheets--There is no 'first' row. Think of your data as this pile of meaningless computer bits thrown somewhere at the bottom of a disk. The data just recently added, doesn't get thrown on top of the older data, it simple gets incorporated into the pile. There is no order to it.

    How you apply order to it is through queries. When you want to retrieve specific data from it you ask the database (in the form of a query) to retreive the data you want, in the order you want. After that query is run, and only when you use an 'ORDER BY' clause does your data have an order among itself. Only within such queries will you're data have a 'first' row.
     
    plog, Oct 1, 2009 IP
  4. timallard

    timallard Well-Known Member

    Messages:
    1,634
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    158
    #4
    that is a great way to explain it, thank you.
     
    timallard, Oct 1, 2009 IP