MySQL Forums
Forum List  »  Newbie

Re: Weekdays and BOOLEANs
Posted by: Felix Geerinckx
Date: August 11, 2005 01:43PM

NeoAmsterdam wrote:

> I had thought of that, but the combination of weekdays are 128. SETs can only hold 64 values.

Huh?

USE test;
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
wd SET('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat')
);

INSERT INTO foo (wd) VALUES
('Thu'),
('Mon,Wed,Thu'),
('Sat,Sun'),
('Mon,Thu');

SELECT id FROM foo WHERE FIND_IN_SET(DATE_FORMAT(CURRENT_DATE, '%a'),wd);

--
felix
Please use BBCode to format your messages in this forum.

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
Re: Weekdays and BOOLEANs
August 11, 2005 01:43PM
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.