通過從表格中獲取文本,該站點被翻譯成不同的。然后程式進入資料庫,翻譯并填寫表格,其中有一個空翻譯。該程式只接受沒有翻譯的文本。為了被翻譯成所有語言,您需要用不同語言的空翻譯復制字串,然后程式將進行翻譯。
在 MYSQL 表中,沒有為翻譯器翻譯行
select text,`from`,`to` from Translation where tran=''

我需要將其他語言的行準備到同一張表中
像這樣的東西
insert into Translation (text,`from`,`to`)
select text, `from`, `to`
from Translation
where `to` not in ('en','zh','ar','th')
and `to` != `from`
and tran = ''
怎么做?
uj5u.com熱心網友回復:
這是要擺弄的東西。它完全未經測驗。只是為了給出一個模式的總體思路,以從種子集中估算缺失值或創建占位符記錄。
WITH
all_language_codes as
( select distinct
`from`
from translations
),
words_which_have_no_translation_in_any_language as
( select text,
`from`
from translations t1
where not exists
( select 1
from translations t2
where t1.text = t2.text
and coalesce(trim(t2.tran),'') <> ''
)
)
select wwt.text,
wwt.from,
alc.from as to,
'' as tran
from words_which_have_no_translation_in_any_language wwt
cross
join all_language_codes alc
where wwt.`from` <> alc.`from`
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/522185.html
標籤:mysqlsql
