Results 1 to 3 of 3

Thread: data range

  1. #1
    Join Date
    Dec 2003
    Posts
    181

    data range

    I need to delete a range of items from 001-099 on a table. I don't want to delete it one-by-one because it will take almost an hour. What will I add to the following statement:

    delete table
    where itemno = '001'

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    delete table
    where itemno >= '001' and itemno <='099'

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    create table x111 (itemno varchar(7),name varchar(100))
    insert into x111 select '001','aw'
    insert into x111 select '002','ae'
    insert into x111 select '003','re'
    insert into x111 select '004','ee'
    insert into x111 select '005','e'
    insert into x111 select '021','w'
    insert into x111 select '091','e'
    insert into x111 select '111','t'
    insert into x111 select '121','g'
    insert into x111 select '241','v'


    select * from x111

    delete from x111 where convert(int,itemno) >=1 and
    convert(int,itemno) <=99


    select * from x111

Posting Permissions

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