tags:

views:

1781

answers:

2

I have two tables with date and id fields, and i need to join on both fields. I tried [code] JOIN t2 ON CONCAT(t1.id, t1.date)=CONCAT(t2.id, t2.date) [/code]

that works, but it is very slow. is there a better way to do this?

A: 
JOIN t2 ON (t2.id = t1.id AND t2.date = t1.date)
Chad Birch
+3  A: 
JOIN t2 ON t1.id=t2.id AND t1.date=t2.date
womble