Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table city( id int auto_increment, name varchar(100), primary key (id) ); insert into city(name) values('москва'), ('якутск'), ('саратов'); select LEAST(city.name, city1.name), GREATEST(city.name, city1.name) from city inner join city as city1 on city1.id != city.id GROUP BY LEAST(city.name, city1.name), GREATEST(city.name, city1.name);

Stuck with a problem? Got Error? Ask AI support!

Copy Clear