hello

ive got a little problem

Using Mysql 4.0.18

i have two tables tb1 and tb2

tb1 has a 2 fields called productgroup, price
and tb2 a field called product and price

tb1.productgroup has some data like

x1, x2, x3

and

tb2.product

x1=1, x1=l1, x2, x3=1l x3=2l ....

now x1 might habe a price

x1=22

and i want to set the price for x1=1 , x1=l1

with a query like

uptdate tb1, tb2 set tb2.price=tb1.price
where tb1.productgroup like tb2.product%

but it didn´t work
has someone an idear
thanks
Ps. ive posted this a time ago but it still bothers me 8)

    I don´t think u can use like in that case u should use =

    and that query makes no sense for me.

    Which table has correct information to update from, table1 or 2?

    why don´t u merge those tables having another with: group, price and product ?

      tb2 has the data to update from

      = wont work <- tb1 has more records than tb2 cause tb2 holds the product group

      well in a analog script this work.

        Write a Reply...