I have attendance record table like this
+----------------+---------+-----------------------+
| NIP | Nama | Date_Time |
+----------------+---------+-----------------------+
| 050803075201 | Supomo | 2013-02-20 07:45:57 |
| 050803075201 | Supomo | 2013-02-20 17:24:13 |
| 050803075201 | Supomo | 2013-02-21 07:53:40 |
| 050803075201 | Supomo | 2013-02-21 17:31:57 |
| 050803075200 | Teguh | 2013-02-21 20:31:02 |
| 050803075200 | Teguh | 2013-02-20 18:18:07 |
+----------------+---------+-----------------------+
Date_Time
is in string format.
And then I want to make it like this table:
+----------------+---------+-------------+-------------+-------------+
| NIP | Nama | Date | In | Out |
+----------------+---------+-------------+-------------+-------------+
| 050803075200 | Teguh | 2013-02-21 | | 18:18:07 |
| 050803075200 | Teguh | 2013-02-20 | | 20:31:02 |
| 050803075201 | Supomo | 2013-02-20 | 07:45:57 | 17:24:13 |
| 050803075201 | Supomo | 2013-02-21 | 07:53:40 | 17:31:57 |
+----------------+---------+-------------+-------------+-------------+
What query will do this?