Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am having the data like Employee ID 123456 he is going on leave from the date of 26-11-2017 till 2-12-2017 .

i am have the MySQL database field names with EmployeeId LeaveDates
so i should get the data inserted in the below format like
EmployeeId LeaveDates
123456 26-11-2017
123456 27-11-2017
.
.
.
.
123456 2-12-2017 like this. can any one suggest me on above question..

What I have tried:

I am able to save the data with
employeeId FromDate Tilldate
123456 26-112017 2-12-2017
but i want separate row wise......
Posted
Updated 26-Nov-17 8:26am
Comments
Richard MacCutchan 26-Nov-17 3:46am    
What exactly is the problem? The SELECT command should be able to find the records you want.
CHill60 26-Nov-17 6:25am    
Can you try to explain your problem again. It is not clear

1 solution

You can use multiple inserts[^]
SQL
INSERT tableName (EmployeeId,LeaveDates) VALUES 
(123456, '2017-11-26'),
(123456, '2017-11-27'),
...
(123456, '2017-12-01'),
(123456, '2017-11-02')
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900