Monday, October 29, 2007

mysql examples

Create a temporary table:
CREATE TABLE TMP_TEST SELECT * FROM MY_TEST;

Populate a temporary table:
insert into sms_dailyrsi select * from tmp_dailyrsi;

MINUS alternative:
select *
from tmp_test left join my_test
on tmp_test.pk1 = my_test.pk1 and tmp_test.pk2 = my_test.pk2
where my_test.pk1 is NULL and my_test.pk2 is NULL;

No comments: