Click here to Skip to main content
15,898,374 members
Home / Discussions / Database
   

Database

 
GeneralRe: how to create a database if data is given? Pin
Eddy Vluggen23-Oct-15 9:14
professionalEddy Vluggen23-Oct-15 9:14 
GeneralRe: how to create a database if data is given? Pin
Member 1127090223-Oct-15 9:20
Member 1127090223-Oct-15 9:20 
GeneralRe: how to create a database if data is given? Pin
Eddy Vluggen23-Oct-15 9:48
professionalEddy Vluggen23-Oct-15 9:48 
GeneralRe: how to create a database if data is given? Pin
Member 1127090223-Oct-15 18:47
Member 1127090223-Oct-15 18:47 
GeneralRe: how to create a database if data is given? Pin
Eddy Vluggen23-Oct-15 23:22
professionalEddy Vluggen23-Oct-15 23:22 
GeneralRe: how to create a database if data is given? Pin
Member 1127090216-Nov-15 23:41
Member 1127090216-Nov-15 23:41 
GeneralRe: how to create a database if data is given? Pin
Eddy Vluggen17-Nov-15 0:46
professionalEddy Vluggen17-Nov-15 0:46 
QuestionAmazon RDS IP Address Pin
R. Giskard Reventlov21-Oct-15 5:21
R. Giskard Reventlov21-Oct-15 5:21 
SuggestionRe: Amazon RDS IP Address Pin
Kornfeld Eliyahu Peter21-Oct-15 8:50
professionalKornfeld Eliyahu Peter21-Oct-15 8:50 
GeneralRe: Amazon RDS IP Address Pin
R. Giskard Reventlov21-Oct-15 9:09
R. Giskard Reventlov21-Oct-15 9:09 
QuestionValidating data between RDBMS (Mysql/ Oracle / DB2) and Hadoop ( HDFS/ Hive) Pin
Member 1204409721-Oct-15 4:14
Member 1204409721-Oct-15 4:14 
AnswerRe: Validating data between RDBMS (Mysql/ Oracle / DB2) and Hadoop ( HDFS/ Hive) Pin
Richard Deeming21-Oct-15 8:12
mveRichard Deeming21-Oct-15 8:12 
QuestionSchema update using SQL Server Data Tools Pin
indian14319-Oct-15 12:15
indian14319-Oct-15 12:15 
AnswerRe: Schema update using SQL Server Data Tools Pin
Mycroft Holmes19-Oct-15 14:35
professionalMycroft Holmes19-Oct-15 14:35 
GeneralRe: Schema update using SQL Server Data Tools Pin
indian14319-Oct-15 15:54
indian14319-Oct-15 15:54 
QuestionReferencing DacPac file from different Server and Database Pin
indian14319-Oct-15 10:34
indian14319-Oct-15 10:34 
AnswerRe: Referencing DacPac file from different Server and Database Pin
Mycroft Holmes19-Oct-15 14:30
professionalMycroft Holmes19-Oct-15 14:30 
QuestionLimiting the scope of a Table variable Pin
indian14317-Oct-15 6:35
indian14317-Oct-15 6:35 
AnswerRe: Limiting the scope of a Table variable Pin
Mycroft Holmes17-Oct-15 13:40
professionalMycroft Holmes17-Oct-15 13:40 
GeneralRe: Limiting the scope of a Table variable Pin
indian14319-Oct-15 10:28
indian14319-Oct-15 10:28 
QuestionMove GROUP_CONCAT's comma values to columns Pin
Jassim Rahma15-Oct-15 6:45
Jassim Rahma15-Oct-15 6:45 
AnswerRe: Move GROUP_CONCAT's comma values to columns Pin
Jassim Rahma15-Oct-15 8:02
Jassim Rahma15-Oct-15 8:02 
Ok, Please HELLLLLP Confused | :confused:

I have this table with 16 rows only:

http://www.jassimrahma.com/temp/attendence_table.png[^]

and I am using below code now to split the time of attendance into columns and getting this result:

http://www.jassimrahma.com/temp/attendence_result.png[^]

but I am not happoy with it! for example, 7th July, there is only one fingerprint so it should be only F1 but it's repeating it in F1, F3 and F4.
SQL
SELECT DATE(attendance_date_time) AS attendance_date, SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(TIME(attendance_date_time)), ',', 1), ',', -1) AS F1,
IF(LENGTH(GROUP_CONCAT(TIME(attendance_date_time))) - LENGTH(REPLACE(GROUP_CONCAT(TIME(attendance_date_time)), ',', '')) > 1,
SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(TIME(attendance_date_time)), ',', 2), ',', -1) ,NULL) AS F2,
SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(TIME(attendance_date_time)), ',', 3), ',', -1) AS F3,
SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(TIME(attendance_date_time)), ',', 4), ',', -1) AS F4
FROM employee_attendance
GROUP BY DATE(attendance_date_time);

How can I fix this please?

Thanks,
Jassim[^]

Technology News @ www.JassimRahma.com

GeneralRe: Move GROUP_CONCAT's comma values to columns Pin
Jassim Rahma24-Oct-15 1:28
Jassim Rahma24-Oct-15 1:28 
QuestionFilling many to many rel table using Select statement Pin
indian14314-Oct-15 7:18
indian14314-Oct-15 7:18 
AnswerRe: Filling many to many rel table using Select statement Pin
Mycroft Holmes14-Oct-15 12:50
professionalMycroft Holmes14-Oct-15 12:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.