Normalizing a MYQL database

Keith Hutchison keith.kjtl.hutchison at gmail.com
Thu Jan 4 17:39:22 CST 2007


G'day Robert

On 1/5/07, Robert Mann <robmann at gp-racing.com> wrote:
> Ok did some searching on "transpose columns into rows"
> There seems to be some way of doing this using SQL but it is above my sql
> knowledge, I found this example I just don't know how to change to input the
> columns into a new table anyone know how to do this? I would prefer to have
> the new table created by this same sql statement if possible.
>
> ----------------------------
> ID     Attribute     Value
> ----------------------------
> 10    username    user1
> 10    password    pass1
> 11    username    user2
> 11    password    pass2
> ---------------------------
>
> I want to rotate this table as follows:
> --------------------------------
> ID     username    password
> --------------------------------
> 10    user1          pass1
> 11    user2          pass2
> --------------------------------
>
> Select T1.ID, T1.Value as UserName, T2.Value as Password from TableName T1
> Inner Join TableName T2 On T1.ID = T2.ID And T2.Attribute = 'password'
> Where T1.Attribute = 'username'
>

MS Access has an transpose wizard.
You could link all your MYSql tables up to an access project
Transpose the tables out, then upload into Valentina.

Regards


-- 
Keith Hutchison
http://balance-infosystems.com http://realopen.org
http://www.kasamba.com/Keith-Hutchison


More information about the Valentina mailing list