MySQL notes: Difference between revisions
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
</pre> | </pre> | ||
Full Text search | |||
<pre> | |||
SELECT | |||
productName | |||
FROM | |||
products | |||
WHERE | |||
MATCH(productName) | |||
AGAINST('1992' WITH QUERY EXPANSION); | |||
</pre> | |||
Revision as of 15:49, 17 May 2023
Notes for working with MySQL
Basic table join for update from one table to another with where clause
UPDATE tableA a JOIN tableB b ON a.a_id = b.a_id JOIN tableC c ON b.b_id = c.b_id SET b.val = a.val+c.val WHERE a.val > 10 AND c.val > 10;
Another way
UPDATE T1, T2, [INNER JOIN | LEFT JOIN] T1 ON T1.C1 = T2.C1 SET T1.C2 = T2.C2, T2.C3 = expr WHERE condition
Full Text search
SELECT productName FROM products WHERE MATCH(productName) AGAINST('1992' WITH QUERY EXPANSION);