help me out for this scenario

help me out for this scenario

am 11.02.2010 06:51:34 von MuraliKrishna

------=_NextPart_000_0009_01CAAB0C.613522F0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

I have a table like as follws



Emp_id, first_login , second_login

1 02/10/09 04/11/09

2 03/10/09 04/11/09

3 04/10/09 05/11/09

4 05/10/09 06/11/09

5 06/10/09 ------------

2 06/10/09 ------------

4 07/10/09 ------------

6 ------------ ------------

3 ------------ ------------

1 ------------ ------------

9 ------------- ------------

7 ------------ ------------

8 ------------ ------------





From this I need a table like



Month, First_total(count(emp_id)), second_total(count(emp_id))



In first and second login the employee id will be consider only one time..
Please help me for this. thanks in advance


------=_NextPart_000_0009_01CAAB0C.613522F0--

RE: help me out for this scenario

am 11.02.2010 17:24:24 von Jerry Schwartz

>-----Original Message-----
>From: MuraliKrishna [mailto:murali_krishna@arthaoptions.com]
>Sent: Thursday, February 11, 2010 12:52 AM
>To: mysql@lists.mysql.com
>Subject: help me out for this scenario
>
>I have a table like as follws
>
>
>
>Emp_id, first_login , second_login
>
[JS] I think you are asking for trouble doing things this way. If life has
taught me anything, it's that someday somebody is going to ask for a
third_login.

You'd be much better off in the long run using a second table for the login
times, even if it seems like overkill. In the second table, store the login
number and time for each occurrence for each user:

Emp_id, login_number, login_time

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com








--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org