On 3/16/2016 7:07 PM,
drum.lucas@xxxxxxxxx wrote:
assuming those two queries 1 and 2 return multiple rows, which rows of junk.wm_260_billables2 match up with what rows of public.ja_mobiusers ? your schema is very poorly defined. I think you need to take a class in relational database design and usage, or read a good book on it at least.. the *CORRECT* SOLUTION WOULD BE MORE LIKE INSERT INTO dm.billables_links (billable_id, mobiuser_id) SELECT b.billable_id, m.id from billables b inner join ja_mobiusers m on b.billable_id = ... where ...... I left ... in because your code fragments are referencing fields that aren't even IN your tables, and your tables don't have sane references. -- john r pierce, recycling bits in santa cruz |