MySQL Forums
Forum List  »  Newbie

Re: Weekdays and BOOLEANs
Posted by: NeoAmsterdam
Date: August 11, 2005 05:13PM

>> I had thought of that, but the combination of weekdays are 128. SETs can only hold 64 values.
> Huh?
When I read that the maximum number of values for SETs are 64, I understood that you can have up to sixty-four different entries for a SET *over the entire table*, like so:
(1) Sun.
(2) Mon.
(3) Sun., Mon.
(4) Tue.
...
(64) Sun., Mon., Tue., Wed., Thu., Fri.

So in the whole of the table, you would have up to 64 different entries for this SET field regardless of how many rows that table holds. Or... uhm... like having 64 radio buttons where you can only chose one.

What I think it *meant* was that you could have up to sixty-four possible values inside the SET *field* like so: `bar SET('one', 'two', 'three', 'four' ... 'sixty-four')` - Like having 64 check boxes that you can turn on and off.

> SELECT id FROM foo WHERE FIND_IN_SET(DATE_FORMAT(CURRENT_DATE, '%a'),wd);
So... `wd` would hold the text 'Sun, Wed, Thu' in its field, and search for the `DATE_FORMAT(CURRENT_DATE, '%a')`?

My hat's off to you - That's VERY clever.

Thank you so much for the help!

Options: ReplyQuote


Subject
Written By
Posted
August 09, 2005 02:50PM
August 10, 2005 02:33AM
August 10, 2005 10:55PM
August 11, 2005 01:11AM
August 11, 2005 12:28PM
August 11, 2005 01:43PM
Re: Weekdays and BOOLEANs
August 11, 2005 05:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.