Results 1 to 5 of 5

Thread: How to do this....

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    55

    How to do this....

    I have met some trouble......
    a program insert some record to DB like this
    ID,Num,Weight,Date,Signer....
    , then print it together, I filter it by Date,SQL like this

    SELECT * FROM shipment WHERE date BETWEEN '2003-10-10' AND '2003-10-11'

    but my boss tell me: I need select ID by myself. so I have to filer it by ID, But the report need a lot of ID,how can I do? I must use the SQL like this??????

    SELECT * FROM shipment WHERE ID = 1 or ID = 2 or ID = 3.....??

    thanks......


  2. #2
    Hyperactive Member
    Join Date
    May 2003
    Posts
    401

    Re: How to do this....

    Try something like this:

    Select * from shipment where ID In (1,2,3,4)
    Enjoy!!!
    apps_tech

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    55
    if I have 100 or more record.........

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    select * from shipment where id between 1 and 100

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    55
    Can I have an other way to do.
    I think maybe I can create a temporary table to do .....

Posting Permissions

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



Click Here to Expand Forum to Full Width