help with crosstab
Posted: Mon Jan 16, 2006 7:07 am
hi i have a big problem with a crosstab. sorry for my bad english is not my first language.
i'm new to mysql so if anyone want's to help please dont send me to the mysql manual i already read theyr tutorials on the matter i just need a example on my table so i can understand.
this is my table
in radcheck i have 2 entries for every UserName in one Attribute is UserPassword with one value
in the second Attribute is Calling-Station-Id with another value
i'm traing to make a select to get every username with the values for username,data,the 2 attributes from radcheck and the attribute from radreply i hope i'm clear about this.
i can't change the names for the fields the database structure has to remain unchanged. Please help. 10x in advance for every response
i'm new to mysql so if anyone want's to help please dont send me to the mysql manual i already read theyr tutorials on the matter i just need a example on my table so i can understand.
this is my table
Code: Select all
CREATE TABLE `data` (
`id` int(11) unsigned NOT NULL auto_increment,
`UserName` varchar(64) NOT NULL default '',
`Data` date NOT NULL default '0000-00-00',
PRIMARY KEY (`id`),
KEY `UserName` (`UserName`(32))
) ENGINE=MyISAM;
CREATE TABLE `radcheck` (
`id` int(11) unsigned NOT NULL auto_increment,
`UserName` varchar(64) NOT NULL default '',
`Attribute` varchar(32) NOT NULL default 'Calling-Station-Id',
`op` char(2) NOT NULL default '==',
`Value` varchar(253) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `UserName` (`UserName`(32))
) ENGINE=MyISAM;
CREATE TABLE `radreply` (
`id` int(11) unsigned NOT NULL auto_increment,
`UserName` varchar(64) NOT NULL default '',
`Attribute` varchar(32) NOT NULL default 'Framed-IP-Address',
`op` char(2) NOT NULL default '=',
`Value` varchar(253) NOT NULL default '192.168.',
PRIMARY KEY (`id`),
KEY `UserName` (`UserName`(32))
) ENGINE=MyISAM;
CREATE TABLE `usergroup` (
`id` int(11) unsigned NOT NULL auto_increment,
`UserName` varchar(64) NOT NULL default '',
`GroupName` varchar(64) NOT NULL default 'PPP',
PRIMARY KEY (`id`),
KEY `UserName` (`UserName`(32))
) ENGINE=MyISAM;in the second Attribute is Calling-Station-Id with another value
i'm traing to make a select to get every username with the values for username,data,the 2 attributes from radcheck and the attribute from radreply i hope i'm clear about this.
i can't change the names for the fields the database structure has to remain unchanged. Please help. 10x in advance for every response