Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
serveurs:mrscandi-ovh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
serveurs:mrscandi-ovh [2021/10/06 15:10] – [SQL AIDE] davidserveurs:mrscandi-ovh [2025/08/20 09:41] (current) – external edit 127.0.0.1
Line 28: Line 28:
 ===== SQL AIDE ===== ===== SQL AIDE =====
  
-Afficher tous les produtis shopping en brouillon avant le 15-09 +** Afficher tous les produits shopping en brouillon avant le 15-09** 
-> SELECT * FROM `wp_posts` WHERE `post_status` LIKE 'draft' AND `post_modified` < '2021-09-15 15:09:01' AND `post_type` LIKE 'shopping' ORDER BY `wp_posts`.`post_modified` ASC+<code `sql`> 
 +SELECT * FROM `wp_posts` WHERE `post_status` LIKE 'draft' AND `post_modified` < '2021-09-15 15:09:01' AND `post_type` LIKE 'shopping' ORDER BY `wp_posts`.`post_modified` ASC 
 +</code>
  
 +
 +** Passer en archive tous les produits shopping en brouillon avant le 15-09**
 +<code `sql`>UPDATE `wp_posts` SET `post_status` = 'archive' WHERE `post_status` LIKE 'draft' AND `post_modified` < '2021-09-15 15:09:01' AND `post_type` LIKE 'shopping'</code>
 +
 +** Afficher tous les produits shopping en brouillon**
 +<code `sql`>SELECT * FROM `wp_posts` WHERE `post_status` LIKE 'draft' AND `post_type` LIKE 'shopping'</code>
 +
 +
 +** Afficher tous les produits shopping en brouillon contenant le mot matelas**
 +<code `sql`>SELECT * FROM `wp_posts` WHERE `post_status` LIKE 'draft' AND `post_type` LIKE 'shopping' AND `post_title` LIKE '%matelas%';</code>
 +
 +** Supprimer tous les produits shopping en brouillon contenant le mot matelas**
 +<code `sql`>DELETE FROM `wp_posts` WHERE `post_status` LIKE 'draft' AND `post_type` LIKE 'shopping' AND `post_title` LIKE '%matelas%';</code>
 +
 +
 +** Afficher les produits les + cliqués **
 +<code `sql`>SELECT p.ID, p.guid, p.post_title, meta_value as nb_clics
 +FROM `wp_postmeta` pm, wp_posts p 
 +WHERE meta_key = 'nb_clics'
 +AND pm.post_id = p.ID
 +ORDER BY CAST(meta_value AS DECIMAL) DESC
 +LIMIT 200;</code>
serveurs/mrscandi-ovh.1633525811.txt.gz · Last modified: (external edit)