DELETE question

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

    #1

    DELETE question

    Hi there

    I want to creat a SQL statment that deletes all records but the first 7
    i have tried
    DELETE FROM dbtable LIMIT 8,100

    but it didn't work, what is the corret way?



    Thanks



    Brian




  • Anna C. Dent

    #2
    Re: DELETE question

    Brian wrote:[color=blue]
    > Hi there
    >
    > I want to creat a SQL statment that deletes all records but the first 7
    > i have tried
    > DELETE FROM dbtable LIMIT 8,100
    >
    > but it didn't work, what is the corret way?[/color]

    define "first 7".
    Based upon which metric/column/criteria?

    The "best" course is to move the scared 7
    to a new table; delete all the records,
    then move the scared 7 back to orginal table.

    Comment

    • Anna C. Dent

      #3
      Re: DELETE question

      Brian wrote:[color=blue]
      > Hi there
      >
      > I want to creat a SQL statment that deletes all records but the first 7
      > i have tried
      > DELETE FROM dbtable LIMIT 8,100
      >
      > but it didn't work, what is the corret way?[/color]

      define "first 7".
      Based upon which metric/column/criteria?

      The "best" course is to move the scared 7
      to a new table; delete all the records,
      then move the scared 7 back to orginal table.

      Comment

      Working...