我有一个包含基本值列表和语言值列表的查询。每个值都有一个与之匹配的键。基本值存储在一个表中,语言值存储在另一个表中。我的问题是我需要从 QUERY 中删除所有匹配的基值,除了一个。然后,我将该查询导出到 Excel 电子表格(我可以很好地完成这部分)并允许用户编辑语言值。
当用户编辑和/或插入新的语言值时,我需要更新数据库,除非现在覆盖数据库中的任何匹配值(比如那些第一次被删除的值)。
简而言之,客户支付翻译费用,如果我可以生成需要较少翻译的工作表(例如经常重复出现的短语),那么他们可以节省资金,因此可以开始项目。我意识到它的缺点是它不是一个真正的链表,其中所有匹配的值都属于语言表中的一行(这很容易)。相反,有多个相同的值需要如上所述更新。
是的,我对此感到困惑,这就是为什么它看起来有点模糊。这是一个示例:
Table 1
Item Description1
Item Description2
Item Description3
Item Description2
Item Description2
Item Description4
Item Description5
Item Description6
Item Description3
Table 2
Item Desc in other Language1
Item Desc in other Language2
Item Desc in other Language3 (blank)
Item Desc in other Language3
Item Desc in other Language4
Item Desc in other Language5
*blank*
期望的结果(查询时)
表1 项目描述1 项目描述2 项目描述3 项目描述4 项目描述5 项目描述6
Table 2
Item Desc in other Language1
Item Desc in other Language2
Item Desc in other Language3 (filled by matching row in Table 2)
Item Desc in other Language4
Item Desc in other Language5
Item Desc in other Language6 (blank, returned as empty string)
用户进行修改,包括将数据插入空白行(如语言的第 6 行),然后重新上传:
Table 1
Item Description1
Item Description2
Item Description3
Item Description2
Item Description2
Item Description4
Item Description5
Item Description6
Item Description3
Table 2
Item Desc in other Language1
Item Desc in other Language2
Item Desc in other Language3 (now matches row below)
Item Desc in other Language3
Item Desc in other Language4
Item Desc in other Language5
Item Desc in other Language6 (new value entered by user)
还有一个资源键将每个“项目描述”与单个“其他语言的项目描述”匹配。他们唯一一次见面是在这个翻译过程中,所有其他时间的值可能不同,所以资源键不能简单地永久更改为一个翻译的所有点。
我还应该补充一点,不应该改变表格的结构或删除表格的行。
好的,这是对我希望查询执行的操作的更新修订,但显然不这样做,因为我实际上需要连接表的值:
SELECT pe.prodtree_element_name_l, rs.resource_value, pe.prodtree_element_name_l_rk
FROM prodtree_element pe
LEFT JOIN resource_shortstrings rs
ON pe.prodtree_element_name_l_rk = rs.resource_key
WHERE rs.language_id = '5'
AND pe.prodtree_element_name_l <> ''
GROUP BY pe.prodtree_element_name_l