Home All Groups Group Topic Archive Search About
Author
3 Aug 2006 10:25 PM
sintral
insert into locationcatalog (cat_id, cat_id, cat_id, cat_id) values
(117, 118, 51, 45)
where catalog.cat_id = 44 in (select locationcatalog.cat_id from
catalog.cat_id inner join locationcatalog
on catalog.cat_id = locationcatalog.cat_id)

This is what I have. What I'm trying to do is insert the values 117,
118, 51, and 45 into the locationcatalog table adding new entries for
customers who have cat_id 44.  What should this look like?

Author
3 Aug 2006 10:29 PM
Chris Lim
sintral wrote:
> insert into locationcatalog (cat_id, cat_id, cat_id, cat_id) values
> (117, 118, 51, 45)
> where catalog.cat_id = 44 in (select locationcatalog.cat_id from
> catalog.cat_id inner join locationcatalog
> on catalog.cat_id = locationcatalog.cat_id)
>
> This is what I have. What I'm trying to do is insert the values 117,
> 118, 51, and 45 into the locationcatalog table adding new entries for
> customers who have cat_id 44.  What should this look like?

I don't understand your table structures, but you should do something
like this:

insert into locationcatalog (cat_id, cat_id, cat_id, cat_id)
select 117, 118, 51, 45
from CustomerCat
where cat_id  = 44

Chris

AddThis Social Bookmark Button