peixue-dev/Archive/[一次性]检查积分数据-2026-01-31.sql

25 lines
691 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 检查积分数据
-- 1. 检查user_points表结构
SHOW CREATE TABLE user_points;
-- 2. 检查user_points表数据
SELECT * FROM user_points ORDER BY id DESC LIMIT 10;
-- 3. 检查points_record表结构
SHOW CREATE TABLE points_record;
-- 4. 检查points_record表数据
SELECT * FROM points_record ORDER BY id DESC LIMIT 20;
-- 5. 检查特定用户的积分数据假设是userId=1
SELECT * FROM user_points WHERE user_id = 1;
-- 6. 检查特定用户的积分记录
SELECT * FROM points_record WHERE user_id = 1 ORDER BY create_time DESC;
-- 7. 统计积分记录类型分布
SELECT type, COUNT(*) as count, SUM(points) as total_points
FROM points_record
GROUP BY type;