複数の値の文字列を持つ可能性のある列「コード」があります。たとえば、「CODE1&CODE2
」...最初の値が必要なだけですJOIN
...code.split("&")[0]
SELECT myTable.*, otherTable.id AS theID
FROM myTable INNER JOIN otherTable
ON myTable.(+++ code before the & +++) = otherTable.code
の値myTable
もCODE1