Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    62

    Unanswered: How to selectively load records that i need?

    I use LOAD DATA INFILE,
    how can i skip rows that i don't want
    example in this flat file

    ID|Nums
    ----
    A|1
    B|1
    C|2

    I want only nums=1 when using load data infile
    load data....
    infile append into tableA
    (id,nums)

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    delete the records you don't want to load from the file.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    You can add the option
    Code:
    ...
    INTO TABLE tableA
      WHEN (nums) = 1
    For details check the manual

Posting Permissions

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