delete data ending in ...

Discussion in 'Databases' started by rober7, Aug 31, 2010.

  1. #1
    it is possible to delete some data ending in "tr" (for exemple)
     
    rober7, Aug 31, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    In MySQL should be:
    
    DELETE FROM TableName WHERE COLUMN_NAME LIKE '%tr';
    
    Code (markup):
    Regards :)
     
    koko5, Aug 31, 2010 IP
  3. Mohie

    Mohie Peon

    Messages:
    122
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    agree with koko5

    DELETE FROM TABLE WHERE YOUR_COLUMN LIKE '%tr';
     
    Mohie, Aug 31, 2010 IP
  4. rober7

    rober7 Well-Known Member

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    138
    #4
    thanks ;) .... you save a lot of time
     
    rober7, Aug 31, 2010 IP
  5. rober7

    rober7 Well-Known Member

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    138
    #5
    and ... another thing ... i have a e-mail adress list and i want to keep only the yahoo hotmail gmail aol users ... is any command to delete the rest?
     
    rober7, Aug 31, 2010 IP
  6. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #6
    Something like this
    DELETE FROM TableName WHERE COLUMN_NAME NOT REGEXP '[[.commercial-at.]](yahoo|gmail|googlemail|aol|hotmail)';
    Code (markup):
    :)
     
    koko5, Aug 31, 2010 IP
  7. joomclan

    joomclan Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    here are some examples
    DELETE FROM example WHERE age='15%'
     
    joomclan, Sep 2, 2010 IP