Good afternoon, All good.
In general, there are 3 tables. You need to select all values, but limit the selection to the limit. In order for the values to be selected by 9 pieces, across the TEXT.id field, and here I do not understand how to do this .
I explain by the fact that it is not quite correctly stated the question.
You need to select 9 records, regardless of how many values are in the SRC table.
For example, in the SRC table 200 records and in the TEXTS table 20 records.
You need to select all the entries where SRC.event_id are the same, but that the sample began from 9 to 18 of the event_i.
CREATE TABLE `SRC`( `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY UNIQUE , `event_id` int(10) NOT NULL , `big_src` VARCHAR(100) NOT NULL , `small_src` VARCHAR(100) NOT NULL , `alternate` VARCHAR(50) NOT NULL, FOREIGN KEY (event_id) REFERENCES TEXTS(id) )ENGINE = MyISAM DEFAULT CHARSET =utf8 COLLATE = utf8_unicode_ci; CREATE TABLE `TEXTS`( `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY UNIQUE , `big_text` VARCHAR(100) NOT NULL , `small_text` VARCHAR(100) NOT NULL , `datetime` DATETIME NOT NULL )ENGINE = MyISAM DEFAULT CHARSET =utf8 COLLATE = utf8_unicode_ci; CREATE TABLE `ALL`( `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY UNIQUE , `TEXT_id` int(10) NOT NULL , `SRC_event_id` int(10) NOT NULL, FOREIGN KEY (TEXT_id) REFERENCES TEXTS(id), FOREIGN KEY (SRC_event_id) REFERENCES SRC(event_id) )ENGINE = MyISAM DEFAULT CHARSET =utf8 COLLATE = utf8_unicode_ci; SELECT event_id,small_src,alternate,small_text,datetime FROM `TEXTS` INNER JOIN `SRC` ON `TEXTS`.id=`SRC`.event_id INNER JOIN `ALL` ON `TEXTS`.id=`ALL`.TEXT_id ; 