Topic: SELECT su FALSE arba TRUE reiksmemis

Sveiki,
turiu lentele kur vardas ir pavarde yra varchar ir char tipo (taip pasidariau pasibandymui).
Visos eilutes yra uzpildytos duomenimis (raides, skaiciai).

SELECT * FROM  `items` WHERE name = FALSE

Kodel su tokia uzklausa as gaunu reiksmes? Ne vienas stulpelis nera tuscias ar su FALSE reiksme.
Visur ivestas raides arba skaiciai.

Re: SELECT su FALSE arba TRUE reiksmemis

pasidalink SHOW CREATE TABLE items; ir keletu sample irasu, patikrinsim kame reples ;)

Re: SELECT su FALSE arba TRUE reiksmemis

Lenteles informacija su keleta duomenu

CREATE TABLE IF NOT EXISTS `items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` tinyint(3) NOT NULL DEFAULT '0',
  `price` double(7,2) NOT NULL,
  `test_c` char(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `items`
--

INSERT INTO `items` (`id`, `name`, `type`, `price`, `test_c`) VALUES
(1, 'cats', 1, 12.25, 'hfgh'),
(2, 'dogs', 0, 11.35, '5asdsa'),
(3, 'house', 1, 7.25, 'asd5ad'),
(4, 'cats2', 2, 5.26, '845465465a');

Uzklausa guri grazina ID 1 ir 3


SELECT * 
FROM  `items` 
WHERE  `test_c` = 
FALSE 
LIMIT 0 , 30

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: SELECT su FALSE arba TRUE reiksmemis

Yra konkretus atsakymas SO: http://stackoverflow.com/questions/8369 … g-in-mysql

matai, vyksta castinimas, ir rows'ai kurie prasideda raide tampa 0, o pats FALSE irgi yra convertinamas i 0;