· 8 years ago · Dec 28, 2017, 03:06 PM
1CREATE TABLE [dbo].[login_user](
2 [idx] [int] IDENTITY(1,1) NOT NULL,
3 [client_id] [int] NOT NULL,
4 [Login] [datetime] NULL,
5 [Logout] [datetime] NULL,
6 [Time] AS (datediff(second,[Login],[Logout])),
7
8CREATE TABLE IF NOT EXISTS `login_user` (
9 `idx` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
10 `client_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
11 `login` DATETIME NULL,
12 `Logout` DATETIME NULL,
13 `Time` AS TIMESTAMPDIFF(second,`login`,`Logout`),
14 PRIMARY KEY (`idx`)
15) ENGINE=MyISAM;