MySQL Forums
Forum List  »  German

Re: SELECT AND SUB SELECT
Posted by: Patrick Gommers
Date: February 14, 2013 05:47PM

Ich möchte eine Liste von Benutzern die in der Log-Tabelle sind. Desweiteren wieviele Log-Einträge jeder Benutzer hat und um ein Verhältnis zu erstellen - die Gesamten-Log-Einträge.

Das mit der userID als VARCHAR ist richtig, dass es falsch ist. Hatte ich versuchsweise geändert.

Der entscheidene Punkt war der Index.


CREATE TABLE IF NOT EXISTS `bsv_log` (
`logID` int(11) NOT NULL AUTO_INCREMENT,
`logKey` varchar(255) COLLATE latin1_german1_ci DEFAULT NULL,
`userID` int(11) NOT NULL DEFAULT '0',
`agent` varchar(255) COLLATE latin1_german1_ci DEFAULT NULL,
`action` text COLLATE latin1_german1_ci,
`created` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`logID`),
KEY `userID` (`userID`),
KEY `logKey` (`logKey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=1728 ;

Wieder was dazu gelernt - danke :)

Options: ReplyQuote


Subject
Views
Written By
Posted
2910
February 13, 2013 06:37PM
1162
February 14, 2013 12:47PM
Re: SELECT AND SUB SELECT
1055
February 14, 2013 05:47PM


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.