Click here to Skip to main content
15,899,313 members
Home / Discussions / Database
   

Database

 
GeneralRe: Need a Sql query Pin
thatraja6-Apr-11 7:58
professionalthatraja6-Apr-11 7:58 
Questioni need help plz Pin
ace3005-Apr-11 6:33
ace3005-Apr-11 6:33 
AnswerRe: i need help plz Pin
Chris Meech5-Apr-11 6:44
Chris Meech5-Apr-11 6:44 
AnswerRe: i need help plz Pin
Om Prakash Pant5-Apr-11 20:31
Om Prakash Pant5-Apr-11 20:31 
QuestionRecords with default values Pin
CodingLover5-Apr-11 0:36
CodingLover5-Apr-11 0:36 
AnswerRe: Records with default values Pin
Wendelius5-Apr-11 2:36
mentorWendelius5-Apr-11 2:36 
QuestionRe: Records with default values Pin
CodingLover5-Apr-11 17:48
CodingLover5-Apr-11 17:48 
AnswerRe: Records with default values Pin
Wendelius5-Apr-11 17:59
mentorWendelius5-Apr-11 17:59 
I would do it permanently since most likely this is not the only case when you need the dates.

To fill the table. Why not create a stored procedure. If you need to fill for a specific period again then you can use the same procedure. Something like:
CREATE PROCEDURE DateFill(d1 DATE, d2 DATE)
BEGIN
   SET @d3 = d1;
   REPEAT
      INSERT INTO DateTable (date_co) VALUES (@d3);
      SET @d3 = DATE_ADD(@d3, INTERVAL 1 DAY);
   UNTIL @d3 > d2 
END;
//


For dropping the table, I wouldn't since if the table is created and permanent you can continue to use it later. Just add a long enough date range to the table (say, 500 years Smile | :) )

Also it might be a good idea to add an index to the table to speed up the usage: http://dev.mysql.com/doc/refman/5.1/en/create-index.html[^]
The need to optimize rises from a bad design.My articles[^]

NewsRe: Records with default values Pin
CodingLover5-Apr-11 18:40
CodingLover5-Apr-11 18:40 
AnswerRe: Records with default values Pin
Wendelius5-Apr-11 18:46
mentorWendelius5-Apr-11 18:46 
GeneralRe: Records with default values Pin
CodingLover5-Apr-11 18:55
CodingLover5-Apr-11 18:55 
GeneralRe: Records with default values Pin
Wendelius5-Apr-11 19:04
mentorWendelius5-Apr-11 19:04 
GeneralRe: Records with default values Pin
CodingLover5-Apr-11 22:14
CodingLover5-Apr-11 22:14 
AnswerRe: Records with default values Pin
Shameel5-Apr-11 5:22
professionalShameel5-Apr-11 5:22 
GeneralRe: Records with default values Pin
CodingLover5-Apr-11 17:53
CodingLover5-Apr-11 17:53 
AnswerRe: Records with default values Pin
jschell6-Apr-11 8:30
jschell6-Apr-11 8:30 
AnswerRe: Records with default values Pin
SilimSayo4-May-11 10:30
SilimSayo4-May-11 10:30 
QuestionRealtime Backups Pin
Lasanthapw4-Apr-11 20:14
Lasanthapw4-Apr-11 20:14 
AnswerRe: Realtime Backups Pin
Wendelius4-Apr-11 20:50
mentorWendelius4-Apr-11 20:50 
AnswerRe: Realtime Backups Pin
Mycroft Holmes4-Apr-11 22:21
professionalMycroft Holmes4-Apr-11 22:21 
GeneralRe: Realtime Backups Pin
Wendelius5-Apr-11 6:03
mentorWendelius5-Apr-11 6:03 
QuestionSchema ideas Pin
Super Lloyd4-Apr-11 17:58
Super Lloyd4-Apr-11 17:58 
AnswerRe: Schema ideas Pin
Wendelius4-Apr-11 18:50
mentorWendelius4-Apr-11 18:50 
GeneralRe: Schema ideas Pin
Super Lloyd4-Apr-11 18:56
Super Lloyd4-Apr-11 18:56 
GeneralRe: Schema ideas Pin
Wendelius4-Apr-11 19:15
mentorWendelius4-Apr-11 19:15 

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.