Hello,
As much as I understand, MySql does not support indexes on substring selects. I have need a query like:
How can I do it with indeses. I have billons of rows in the tables.
Thanks
Adnan
As much as I understand, MySql does not support indexes on substring selects. I have need a query like:
Code:
SELECT DISTINCT C.CODE, C.NAME FROM mtt_table1 A, mtt_table2 B, mtt_table3 C, mtt_table4 D WHERE 1 AND (C.NAME LIKE '%abc%' OR C.KEYWORDS LIKE '%abc%') AND ( SUBSTRING(B.GTIP,1,4) = A.GTIP or SUBSTRING(B.GTIP,1,6) = A.GTIP OR SUBSTRING(B.GTIP,1,8) = A.GTIP ) AND C.CODE = B.CODE AND D.GTIP = A.GTIP
Thanks
Adnan