SELECT id, NAME, age WHERE student s1 INNER JOIN ( SELECT id FROM student ORDER BY age LIMIT 50,5 ) AS s2 ON s1.id = s2.id
Union查询默认去重,如果不是业务必须,建议使用效率更高的Union All
CREATE TABLE triangle (sidea DOUBLE, sideb DOUBLE, area DOUBLE AS (sidea * sideb / 2)); insert into triangle(sidea, sideb) values(3, 4); select * from triangle;
------- ------- ------ | sidea | sideb | area | ------- ------- ------ | 3 | 4 | 6 | ------- ------- ------
CREATE TABLE json_test (name JSON); INSERT INTO json_test VALUES('{"name1": "value1", "name2": "value2"}'); SELECT * FROM json_test WHERE JSON_CONTAINS(name, '$.name1');
EXPLAIN SELECT settleId FROM Settle WHERE settleId = "3679"