I used to dabble with SQL in my last job, using Open Office Base to try to create an MRPII system, but that was six months ago, things are different now.
So I've got me one new table, which looks a little like this:-
|4||Streeter, Gary||Constituency||Devon, SW|
|5||Abbott, Dianne||2005 Majority||7427|
|6||Wyatt, Derek||Expense fiddle link||http://www.telegraph.co.uk/news/newstopics/mps-expenses/5330808/Labour-MP-Derek-Wyatt-billed-75p-for-scotch-eggs-MPs-expenses.html|
I think keeps it all kind of simple, rather than having to add columns or create new tables everytime something new happens. Its probably some technique they teach you in first year database management, I swear I read some techy article about this sort of way of arranging databases years and years ago.
Anyhoo, whilst its easy to do a wee
SELECT Name, Value FROM mpinfo WHERE 'Attribute' = 'Constituency' ORDER BY Nameor
SELECT Name, Value FROM mpinfo WHERE 'Attribute' = 'Party' ORDER BY Party, Nameto get lists of each homogenous atrribute. I'm wanting to display a table which has columns for 'MPs name', 'Constituency', 'Party' and whatever else.
Lazyweb, can you help?
It should simply be a case of joining the results of the two previous SQL queries
SELECT Name, Value FROM mpinfo WHERE 'Attribute' = 'Constituency'But that's clearly not going to work, so can I run an SQL query that creates two new tables, one for each of the previous queries, then joins them, spits forth the desired information, and then drops the tables.
SELECT Name, Value FROM mpinfo WHERE 'Attribute' = 'Party'
And can I do this within phpMyAdmin?