sql запрос, помогите

chemax
На сайте с 07.01.2009
Offline
206
318

SELECT 

`manufacturer`.`id` as `manufacturer_id`,
`manufacturer`.`title` as `manufacturer_title`,
(select `collection`.`id` from `collection` where `product`.`collection_id`=`collection`.`id` and `product`.`manufacturer_id`=`manufacturer`.`id`) as `collection_id`,
(select `collection`.`title` from `collection` where `product`.`collection_id`=`collection`.`id` and `product`.`manufacturer_id`=`manufacturer`.`id`) as `collection_title`
FROM
`product`
JOIN
`manufacturer`
ON
`product`.`manufacturer_id`=`manufacturer`.`id`

как оптимизировать:

				(select `collection`.`id` from `collection` where `product`.`collection_id`=`collection`.`id` and `product`.`manufacturer_id`=`manufacturer`.`id`) as `collection_id`,

(select `collection`.`title` from `collection` where `product`.`collection_id`=`collection`.`id` and `product`.`manufacturer_id`=`manufacturer`.`id`) as `collection_title`
Качественный хостинг, VPS и сервера. (http://ihc.ru/?ref=569)

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий