Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: need help with INSERT INTO.... WHERE

    hey guys,

    i'm trying to insert text into a column where another column has a certain value or matches a certain text.

    for example,

    where firstname ilike 'joe' i want to insert ('blue') into favorite color column.

    i try the following queries but so far i get parse errors.

    INSERT INTO mytable (favoritecolor) VALUES ('blue') WHERE (firstname) ilike '%joe%' ;

    INSERT INTO mytable (favoritecolor) WHERE (firstname) ilike '%joe%' VALUES ('blue') ;

    i have tried several other ways but so far nothing works and i can't figure out what i am missing or doing wrong.

    i greatly appreciate your help.

  2. #2
    Join Date
    Sep 2003

    i figured it out using UPDATE.

    UPDATE mytable set favoritecolor='blue' WHERE firstname ilike'%joe%';

Posting Permissions

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