2
BD WordPress的 - 表:wp_term_relationshipsMYSQL更新選擇 - 升級列
object_id | term_taxonomy_id| term_order 1 | 23 | 0 2 | 22 | 0 3 | 23 | 0 4 | 22 | 0 5 | 23 | 0 6 | 21 | 0
我需要算多少「產品」在每一個「類」屬於在列「term_order」
例如插入:
object_id | term_taxonomy_id| term_order 1 | 23 | 3 2 | 22 | 2 3 | 23 | 3 4 | 22 | 2 5 | 23 | 3 6 | 21 | 1
我做了這樣的事情,但它沒有更新的領域 'term_order':
UPDATE `letras`.`wp_term_relationships`
SET `term_order` = '2'
WHERE `wp_term_relationships`.`object_id` = '5' ;
SELECT object_id as id_objeto,
COUNT( `object_id`) quantidade
FROM wp_term_relationships
WHERE `object_id` = `object_id`
GROUP BY `term_taxonomy_id`
錯誤: 1064 - SQL中有錯誤語法;檢查與您的MySQL服務器版本相對應的手冊,以便在第3行的wp_term_relationships t join(select term_taxonomy_id,count(*)cn)附近使用正確的語法。 – user2718396
@ user2718396 - 查看更新。 DBMS。 – sgeddes