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 paths (id int primary key auto_increment, path varchar(255)); insert into paths(path) values ('/'),('/a/'),('/a/b/'),('/a/b/c/'),('/a/b/c/d'); select * from paths; -- select childs of /a/b/ select * from paths where path like ('/a/b/%'); -- select parents of /a/b/ select * from paths where '/a/b/' like concat(path,'%');

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

Copy Clear