I have Table 1:
ID UserString Date ------------------------- 1 KRBS 4/25/2014 2 WEFG 4/24/2014 And Table 2:
ID UserString + Other user info ---------------------------------- 1 KRBS + . . .. . I'm preforming insert into Table 1 but I would like to make a condition to only insert if the user is already available in Table 2 (only only insert row in table 1 if user already exist in table2)
I'm currently doing two separate SQL checks (one if user exist then insert) but I'm sure there is a better way
insert into t1 (userstring, date) select 'newuserstring', 'newdate' from othertable where ...