I think that I must be missing something, as I agree with all the suggestions that to change the seperate date element columns to a single date field, but Meli's original post had a date falling into multiple quarters. Now to my knowledge, a date can only be in one quarter, from a calendar point of view, so maybe there's something more to Meli's issue...
to store the info more efficiently for what you're saying, you could also use binary as a guide 1 2 3 4 s n r t t d d h _______ 8 4 2 1 - - - - 1000 = 8 0100 = 4 0010 = 2 0001 = 1 1100 = 12 1010 = 10 1001 = 9 0110 = 6 0101 = 5 0011 = 3 1110 = 14 1101 = 13 1011 = 11 0111 = 7 1111 = 15 0000 = 0 (which you don't have below but here for completeness) and store a single number that represents the pattern you have below, replacing 'null' with 0 and x as 1 > > x null null null > > null x null null > > null null x null > > null null null x > > x x null null > > x null x null > > x null null x > > null x x null > > null x null x > > null null x x > > x x x null > > x x null x > > x null x x > > null x x x > > x x x x Ladies and Gentlemen, the first real use of the bitwise section of the java certification exam I have ever used!!!!!!!! > -----Original Message----- > From: Brent Baisley [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 12, 2003 9:01 AM > To: Meli Meli > Cc: [EMAIL PROTECTED] > Subject: Re: Database-design > > > Why would you created separate fields for each quarter? > Create a field > called quarter and store a number in it. You could also combine year, > month and day into a date field, which would make it easier to search > on ranges. > So, I think your table should look like this: > id > quarter > eventdate > week > > > On Tuesday, November 11, 2003, at 02:33 PM, Meli Meli wrote: > > > > > I have a table with following structure: > > > > Id > > first quarter > > second quarter > > third quarter > > last quarter > > year > > month > > week > > day > > > > On an entry not all fields of the four quarter fields are > covered with > > values. > > Following combinations are possible: > > > > first quarter | second quarter | third quarter | last quarter > > > > > > > > x null null null > > > > null x null null > > > > null null x null > > > > null null null x > > > > x x null null > > > > x null x null > > > > x null null x > > > > null x x null > > > > null x null x > > > > null null x x > > > > x x x null > > > > x x null x > > > > x null x x > > > > null x x x > > > > x x x x > > > > > > > > The table will receive many thousands of entry's. > > > > Would it be better to divide the table in to 15 small > tables in order > > to not register fields with null values? > > > > > > > > Thanks for helping > > > > Regards Martin > > > > > > > > --------------------------------- > > Do you Yahoo!? > > Protect your identity with Yahoo! Mail AddressGuard > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]