I have a table with the structure
book_id int(11), section_id int(11), note_id int(11), item_number int(11), text varchar(255), UNIQUE(book_id,section_id,note_id,item_number)
item_number can be 1 or 2 only.
How can I make a
SELECT query to get text for item_number 1 and 2 together for each
SELECT book_id, select_id, note_id, TEXT_number_1, TEXT_number_2 TEXT_number_1 = text (WHERE item_number=1) TEXT_number_2 = text (WHERE item_number=2)
I considered two options:
GROUP BY, which can give me a CONCAT(TEXT_number_1,TEXT_number_2)
JOIN, which I am not sure what is the best query.