-- 20 most recent active users from Texas, oldest signup first
SELECT id,
name,
email,
created_at
FROM users
WHERE state = 'TX'
AND status = 'active'
AND created_at >= NOW() - INTERVAL '30 days'
ORDER BY created_at ASC
LIMIT 20;
-- Tip: prefer the column LIST over SELECT * — it makes the query
-- forward-compatible (a new column won't change your output shape),
-- documents intent, and is faster when wide tables have unused BLOBs.
Create a free account and build your private vault. Share publicly whenever you want.