SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE users ( id SERIAL PRIMARY KEY, nane text -- other columns ); CREATE TABLE categories ( key SERIAL PRIMARY KEY, user_id int, nane text -- other columns ); SELECT users.*, categories.key as category FROM users JOIN categories ON categories.user_id = users.id WHERE categories.key = 1 ;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear