Ben gibi basit veri mysql tablo var:
şimdi ben bu basit sorgu çalıştırdığınızda:
SELECT MAX(cashback) as MAX, MIN(cashback) as MIN FROM pearlcashback_retailers_category WHERE retailer_id='32' AND cashback NOT LIKE '%\%'
Bu çıkışlar:
ve bu sorgu için:
SELECT MAX(cashback) as MAX, MIN(cashback) as MIN FROM pearlcashback_retailers_category WHERE retailer_id='32' AND cashback LIKE '%\%'
Bu çıkışlar:
lütfen bana yardım edin ...
Tablonun ve SQL verileri:
CREATE TABLE IF NOT EXISTS `pearlcashback_retailers_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`retailer_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`cashback` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
INSERT INTO `pearlcashback_retailers_category` (`id`, `retailer_id`, `category_id`, `cashback`) VALUES
(1, 32, 17, '46%'),
(2, 32, 14, '40'),
(11, 4, 15, '27%'),
(9, 32, 15, '5'),
(8, 32, 7, '44%'),
(14, 3, 13, '1');