SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE [tableName] (Value varchar(64), Identifier varchar(64)); INSERT INTO [tableName] VALUES ('Title_Name1', 'Collection_Title'), ('Title_Name2', 'Collection_Title'), ('Title_Name3', 'Collection_Title'), ('Image_URL1', 'Collection_Image'), ('Image_URL2', 'Collection_Image'); SELECT Images.value, Images.identifier, Titles.value, Titles.identifier FROM ( SELECT value, identifier, row_number() over(order by value) rn FROM [tableName] WHERE identifier = 'Collection_Image' ) Images FULL OUTER JOIN ( SELECT value, identifier, row_number() over(order by value) rn FROM [tableName] WHERE identifier = 'Collection_Title' ) Titles ON Images.rn = Titles.rn;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear