我有两个如下表。
句子
+--------+----------+-----------------------------------------------------------------------+
| id | language | text |
+--------+----------+-----------------------------------------------------------------------+
| 519125 | epo | Mia onklo aĉetis por mi horloĝon kiu estas tre akurata. |
| 519126 | epo | Mi ne povas akcepti vian donacon. |
| 519127 | uig | ئۇ پۈتۈن مەملىكەتنى ئارىلاپ چىقماقچى. |
| 519128 | eng | She's planning to travel the entire country. |
| 519129 | eng | He's planning to travel the entire country. |
| 519130 | uig | تاڭنىڭ ئالدىدا قاراڭغۇسى بار. |
| 519131 | epo | Li trovas kritikindan en ĉio kion mi faras. |
+--------+----------+-----------------------------------------------------------------------+
和
链接
+------------+--------------+
| sentenceId | translatedId |
+------------+--------------+
| 124665 | 1972285 |
| 124666 | 279328 |
| 124666 | 957578 |
| 124667 | 279327 |
| 124667 | 440607 |
+------------+--------------+
它们由数百万行组成。我想在第二个表之后再添加两列,sentenceId
如下translatedId
所示:
+------------+-------------+--------------+-------------+
| sentenceId | languageId1 | translatedId | languageId2 |
+------------+-------------+--------------+-------------+
在上表中(sentenceId languageId1)和(translatedId languageId2)确实是一对。languageId1
并分别显示和languageId2
的语言简写。但是在语言列的第一个表中定义了sentenceId 和translatedId 的语言简写。为了形成该表,必须在第一个表中查找每个和 translateId 值,并且必须在and中替换找到的语言简写。那么我怎样才能形成上表呢?sentenceId
translatedId
sentenceId
languageId1
languageId2