Most popular product titles to attract first-time buyers
P粉164942791
P粉164942791 2023-09-01 18:51:31
0
1
624
<p>Suppose I have a table with a DateTime column called purchase_time and other order details (store_id, buyer_id, item_id, value) and I want to find what buyers purchased most often during their first purchase product name. </p> <p>So far I've done this, but how do I find the most popular items? </p> <pre class="brush:php;toolbar:false;">select store_id, from transactions where purchase_time in (select min(purchase_time) from transactions c1 group by c1.store_id);</pre></p>
P粉164942791
P粉164942791

reply all(1)
P粉848442185
SELECT TOP 1 i.item_name
FROM Transactions t
INNER JOIN Items i ON i.item_id = t.item_id
WHERE purchase_time = (select *, MIN(purchase_time) FROM Transactions)
GROUP BY 1
ORDER BY COUNT(*)  DESC
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template