SQL
28 Oct 2009
 
 
 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
SELECT node.nid AS nid,
uc_products.model AS uc_products_model,
uc_products.nid AS uc_products_nid,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_attr_1.field_attr_1_value AS node_data_field_attr_1_field_attr_1_value,
node_data_field_attr_2.field_attr_2_value AS node_data_field_attr_2_field_attr_2_value,
node_data_field_attr_3.field_attr_3_value AS node_data_field_attr_3_field_attr_3_value,
node_data_field_attr_4.field_attr_4_value AS node_data_field_attr_4_field_attr_4_value,
uc_products.sell_price AS uc_products_sell_price,
node_data_field_sale.field_sale_value AS node_data_field_sale_field_sale_value,
node_data_field_new_product.field_new_product_value AS node_data_field_new_product_field_new_product_value,
node.created AS node_created
FROM node node
LEFT JOIN term_node term_node_value_0 ON node.vid = term_node_value_0.vid AND term_node_value_0.tid = 213
LEFT JOIN uc_products uc_products ON node.vid = uc_products.vid
LEFT JOIN content_field_attr_1 node_data_field_attr_1 ON node.vid = node_data_field_attr_1.vid
LEFT JOIN content_field_attr_2 node_data_field_attr_2 ON node.vid = node_data_field_attr_2.vid
LEFT JOIN content_field_attr_3 node_data_field_attr_3 ON node.vid = node_data_field_attr_3.vid
LEFT JOIN content_field_attr_4 node_data_field_attr_4 ON node.vid = node_data_field_attr_4.vid
LEFT JOIN content_field_sale node_data_field_sale ON node.vid = node_data_field_sale.vid
LEFT JOIN content_field_new_product node_data_field_new_product ON node.vid = node_data_field_new_product.vid
WHERE (node.type in ('product', 'climat', 'energo', 'tech')) AND (node.vid IN (
SELECT tn.vid FROM term_node tn
WHERE tn.tid = 100
)) AND (term_node_value_0.tid = 213) AND (uc_products.sell_price >= 0) AND (uc_products.sell_price <= 500) AND (node.status <> 0)
ORDER BY node_created DESC
LIMIT 0, 6;