Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simplify SQL string


Sousa

Recommended Posts

SELECT

`categories`.`categories_id`,

`categories_description`.`categories_name`,

`categories_description`.`language_id`,

`categories`.`categories_image`,

`categories`.`parent_id`,

`categories`.`sort_order`

FROM

`categories`

Inner Join `categories_description` ON `categories`.`categories_id` = `categories_description`.`categories_id`

WHERE

`categories_description`.`language_id` = '4' AND

`categories`.`parent_id` = '1'

 

 

anyone can make it simple?

KUBICO from Portugal

Link to comment
Share on other sites

Is this a mysql test? :)

 

 

select c.categories_id, c.categories_image, c.parent_id, c.sort_order, cd.categories_name, cd.language_id from categories c, categories_description cd where c.parent_id = 1 and cd.language_id = 4 and c.categories_id = cd.categories_id

 

should give you the same results. for what you are looking for you really can't simplify it further.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...