Guest

Untitled

By: a guest on Mar 18th, 2010  |  syntax: SQL  |  size: 0.56 KB  |  hits: 136  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. SELECT
  2.       COUNT(p.products_id) AS total
  3.    FROM
  4.          products_description pd,
  5.  
  6.          products p
  7.       LEFT JOIN
  8.          manufacturers m
  9.       ON
  10.          (p.manufacturers_id = m.manufacturers_id),
  11.          
  12.          products_to_categories p2c
  13.       LEFT JOIN
  14.          specials s
  15.       ON
  16.          (p.products_id = s.products_id)
  17.    WHERE
  18.       p.products_status = '1'
  19.       AND
  20.       p.products_id = p2c.products_id
  21.       AND
  22.       pd.products_id = p2c.products_id
  23.       AND
  24.       pd.language_id = '1'
  25.       AND
  26.       p2c.categories_id = '60'