I am not sure that it is possible. My problem is to get only one row from database. Table described below:
CREATE TABLE IF NOT EXISTS `t_translate_content_pages` (
`translate_content_page_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`content_page_id` int(10) unsigned NOT NULL,
`language_code` varchar(3) NOT NULL,
`content_page_title` varchar(255) NOT NULL,
`content_page_text` text NOT NULL,
PRIMARY KEY (`translate_content_page_id`),
KEY `content_page_id` (`content_page_id`),
KEY `language_id` (`language_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
INSERT INTO `t_translate_content_pages`
(`translate_content_page_id`, `content_page_id`, `language_code`, `content_page_title`, `content_page_text`) VALUES
(3, 1, 'en', 'About', 'some text'),
(5, 1, 'ie', 'about', 'text');
I need to get only one row. If in database is record with language_code
='ru' in result to have that record, if there is not to get record with language_code
='en'. Will be very good to set this clause in WHERE clause of Sql query.
Regards to all.