MySQL Forums
Forum List  »  PHP

Re: Query divides movie titles into different columns
Posted by: Peter Brawley
Date: November 14, 2019 02:21PM

If you want a new column for each instance of a key, you'll need to run a first query for such counts, compute how many columns are needed, then in a stored procedure, or a PHP function, programmatically generate the desired query.

And it'd be an odd query to read.

Better perhaps to use Group_Concat(), which was developed in MySQL for just such instances.

Edited 1 time(s). Last edit at 11/14/2019 02:22PM by Peter Brawley.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.