Useful Ultimate Auction SQL Queries???
-
If you have SQL access to your WordPress DB, or you know how to code pages that query and report, the following may be useful to you .. please let me know if there are any errors or if anyone thinks of other useful queries…
#list INCREMENTAL values for ALL AUCTIONS SELECT p.ID,p.post_title,m.meta_key,m.meta_value from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and m.meta_key = "wdm_incremental_val" #list OPENING bid for ALL AUCTIONS SELECT p.ID,p.post_title,m.meta_key,m.meta_value from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and m.meta_key = "wdm_opening_bid" #list HIGHEST BID for ALL AUCTIONS select p.ID,p.post_title,b.name,max(b.bid) from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_wdm_bidders b where p.ID = b.auction_id group by p.ID order by p.ID asc, b.bid desc #MOST ACTIVE auctions by bid_count ALL AUCTIONS select p.ID,p.post_title,count(b.bid) as bid_count from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_wdm_bidders b where p.ID = b.auction_id group by p.ID order by bid_count desc #list 10 RECENT BIDS select p.ID,p.post_title,b.name,b.bid, max(b.date) as bid_date from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_wdm_bidders b where p.ID = b.auction_id group by p.ID order by bid_date desc LIMIT 10 #list END DATES DESCENDING SELECT p.ID,p.post_title,m.meta_key,m.meta_value from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and m.meta_key = "wdm_listing_ends" order by m.meta_value desc limit 200 <strong>#BULK update listing END DATE for all LIVE auctions -- WARNING, THIS WILL EDIT DATA</strong> update YOUR-TABLE-PREFIX_postmeta set meta_value = "2014-03-14 23:59:59" where meta_key = "wdm_listing_ends" and meta_value > NOW() #CURRENTLY LIVE AUCTIONS ENDING within 24 hours SELECT p.ID,p.post_title,m.meta_key,m.meta_value from YOUR-TABLE-PREFIX_posts p, YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and m.meta_key = "wdm_listing_ends" and m.meta_value < DATE_ADD(NOW(), INTERVAL 24 HOUR) and m.meta_value > NOW() order by m.meta_value desc limit 200 #CURRENTLY LIVE Auctions CREATED in last 24hrs SELECT p.ID,p.post_title,p.post_date from YOUR-TABLE-PREFIX_posts p,YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and p.post_date > DATE_SUB(NOW(), INTERVAL 24 HOUR) and m.meta_key = "wdm_listing_ends" and m.meta_value > NOW() order by p.post_date desc limit 200 #currently LIVE Auctions MODIFIED in last 24hrs SELECT p.ID,p.post_title,p.post_modified from YOUR-TABLE-PREFIX_posts p,YOUR-TABLE-PREFIX_postmeta m where p.ID = m.post_id and p.post_modified > DATE_SUB(NOW(), INTERVAL 24 HOUR) and m.meta_key = "wdm_listing_ends" and m.meta_value > NOW() order by p.post_modified desc limit 200 #AUCTIONS WITH NO BIDS select * from (select p.ID,p.post_title,count(b.bid) as bid_count,m.post_id from YOUR-TABLE-PREFIX_posts p INNER JOIN YOUR-TABLE-PREFIX_postmeta m on p.ID = m.post_id LEFT OUTER JOIN YOUR-TABLE-PREFIX_wdm_bidders b on p.ID = b.auction_id where m.meta_key = "wdm_listing_ends" and m.meta_value > NOW() group by p.ID,m.post_id order by bid_count desc) as no_bids where bid_count = 0 LIMIT 200
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Useful Ultimate Auction SQL Queries???’ is closed to new replies.