CREATE TABLE hts_item_detail item_id bigint NOT NULL COMMENT item id meta_no bigint NOT NULL COMMENT meta no item_address varchar64 CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMEN
To query the table hts_item_detail and display the columns amount, list_end_time, owner_no, and event_id, while also counting the number of records, and sorting the amount column in ascending order based on event_id grouping, you can use the following SQL query:
SELECT amount, COUNT(*) AS count, list_end_time, owner_no, event_id
FROM hts_item_detail
GROUP BY event_id
ORDER BY event_id ASC, amount ASC;
This query will return the selected columns (amount, list_end_time, owner_no, and event_id), along with the count of records for each group of event_id. The results will be sorted in ascending order based on event_id and then amount
原文地址: https://www.cveoy.top/t/topic/iE0b 著作权归作者所有。请勿转载和采集!