Results 1 to 6 of 6

Thread: sql course

  1. #1
    Join Date
    Jul 2011
    Posts
    8

    sql course

    when I am follow the instruction to delete a single data from my database that I have create. It delete all of my database.

    I am typing the sql string correctly but it keep deleting all of my data from my table.

    I have went through the tutorial twice and when I get to the delete part I am having trouble.

    delete
    from myemployees_ts0211
    where lastname =
    'Weber-Williams';

    this is the code I am using.
    Last edited by myallsql_01; 08-15-2011 at 02:09 PM.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    What is in the myemployees_ts0211 table?. Are all records with same lastname -weber-williams'?

  3. #3
    Join Date
    Jul 2011
    Posts
    8
    There was only one record with lastname Webser-willaims.

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    What do you see in the records affect message? It does not make sense that it is deleting everything in the table.

    Can you try moving the name string to the same line as the comparison column

    delete
    from myemployees_ts0211
    where lastname = 'Weber-Williams';

  5. #5
    Join Date
    Jul 2011
    Posts
    8
    yeah it doesn't make sense but believe me it does. I created a database and it delete it. I create a next database and the same thing happen again. Maybe there is a bug somewhere?

  6. #6
    Join Date
    Jul 2012
    Posts
    4
    Can you delete by ID just to see if that acts differently?

    delete
    from myemployees_ts0211
    where id = 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •