Jump to content

insert into tablea if conditions meet data from tableb?


onedumbcoder

Recommended Posts

You could do something like this:

insert into tablea(a,b,c)
select a, b, c from
(
select 
	'1' as a,
	'2' as b,
	'3' as c,
	'someID' as id,
	'somepassword' as password
) as tmp
inner join tableb on tableb.id = tmp.id and tableb.password = tmp.password

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.