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 jobs ( id SERIAL PRIMARY KEY, title VARCHAR(100) NOT NULL, po_category TEXT NOT NULL ); INSERT INTO jobs (title, po_category) VALUES ('Plumber', '64,93,97'), ('Electric', '64'), ('Painter', '93,97'), ('Driver', '12,64'), ('Chef', '93'); SELECT * FROM "jobs" WHERE 64 = ANY(STRING_TO_ARRAY(po_category,',')::INTEGER[]) OR 97 = ANY(STRING_TO_ARRAY(po_category,',')::INTEGER[])

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

Copy Clear