[英]Update colPos with typo3 extension flux 9.0.1
Since the update flux to 9.0.1 I need to update the colPos of elements. 由于将更新量更新为9.0.1,因此我需要更新元素的colPos。
This works fine: 这很好用:
UPDATE `tt_content`
SET colPos = ((tx_flux_parent * 100) + 11)
WHERE tx_flux_column = "content";
But I need also to update the localized content elements. 但是我还需要更新本地化的内容元素。 It have in tx_flux_parent the localized parent uid.
它在tx_flux_parent中具有本地化的父uid。 But I need the parent uid of the standard language.
但是我需要标准语言的父uid。
I need to get the value "tx_flux_parent" in tt_content by l18n_parent. 我需要通过l18n_parent在tt_content中获取值“ tx_flux_parent”。 So I'm trying to build a query with l18n_parent like this:
所以我正在尝试使用l18n_parent建立一个查询,如下所示:
UPDATE `tt_content` as t1
SET colPos = (( (SELECT t2.tx_flux_parent
FROM tt_content t2
WHERE t1.l18n_parent = t2.uid) * 100) + 11)
WHERE t1.tx_flux_column = "content";
And get this: 并得到这个:
MySQL meldet: Dokumentation 1093 - Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
MySQL融合:文档1093-表't1'被指定两次,既作为'UPDATE'的目标又作为数据的单独来源
MySQL does not allow referencing the table being updated again in another subquery, unless it is inside the FROM
clause ( Derived Table ). MySQL不允许在另一个子查询中再次引用正在更新的表, 除非它位于
FROM
子句( 派生表 )中。
However, in this particular case, you can rather use "Self-Join": 但是,在这种情况下,您可以使用“ Self-Join”:
UPDATE `tt_content` as t1
JOIN `tt_content` as t2
ON t1.l18n_parent = t2.uid
SET t1.colPos = ((t2.tx_flux_parent * 100) + 11)
WHERE t1.tx_flux_column = 'content'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.