I have a joint table that gives me a list of IDs and some verbs as:
id | name
------------
23 | sell
123 | steal
25 | assault
....
I need to end up with a new table that will have an auto-increment column, the IDs column and as other columns all the verbs in the name column. Similar to:
id | sell | steal | assault
-------------------------------
23 |
123 |
...
I know how to create a table and have an auto-increment ID or get the IDs in the table but don't know how to make fields from a joint table(or any table) as columns. Is there a way to do this in one SQL statement? Either that or using Java ?