Skip to content

Instantly share code, notes, and snippets.

@cybernet
Created October 16, 2014 23:14
Show Gist options
  • Save cybernet/d8472ee1c208fc67639a to your computer and use it in GitHub Desktop.
Save cybernet/d8472ee1c208fc67639a to your computer and use it in GitHub Desktop.
id, ch1, ch2, ch3, ch4
CREATE TABLE IF NOT EXISTS `concat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ch1` varchar(41) NOT NULL,
`ch2` varchar(41) NOT NULL,
`ch3` varchar(41) NOT NULL,
`ch4` varchar(41) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `concat`
--
INSERT INTO `concat` (`id`, `ch1`, `ch2`, `ch3`, `ch4`) VALUES
(1, 'a', 'b', 'c', 'd'),
(2, 'g', 'i', 'q', 'm'),
(3, 'g', 'r', 'a', 'm');
SELECT * FROM `concat` WHERE `ch1` LIKE 'g' AND `ch2` LIKE 'r' AND `ch3` LIKE 'a' AND `ch4` LIKE 'm';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment