SQL语句解读服务
sql.ohrz.net
查看示例
SELECT语句
UPDATE语句
INSERT语句
DELETE语句
UNION语句
LEFT JOIN语句
INSERT SELECT语句
带子查询的语句
带嵌套子查询的语句
MySQL视频教程
SELECT product_id, MAX(price) AS max_price, MIN(price) AS lowest_price FROM products WHERE product_id > 5 GROUP BY product_id HAVING max_price > 100 ORDER BY max_price LIMIT 5
原SQL语句
解读结果
查
从表
products
中
FROM
按条件
WHERE
product_id
>
5
按
product_id
分组
GROUP BY
过滤出
HAVING
max_price
>
100
按
max_price
升序排序
ORDER BY
取出
SELECT
product_id
MAX
(
price
)
(记为max_price)
MIN
(
price
)
(记为lowest_price)
取5条记录
LIMIT