View difference between Paste ID: EzXvTRLY and tYFtaRF7
SHOW: | | - or go back to the newest paste.
1
select cped.entity_id as `Product ID`,
2
cpe.type_id as `Type`,
3
cpe.sku,
4
name.value as `Name`,
5
cped.store_id as `Store ID`,
6
store.code as `Store code`,
7
store.name as `Store name`,
8-
 ,cpei_status.value as `Status`
8+
9
 ,cped_price.value as `Price`
10
 ,cpev_style.value as `Style`
11
 ,(if (cpei_status.value='1', 'Enabled', if (cpei_status.value='2','Disabled','Not set'))) as `Status text`
12
 ,(if (cpei_status.value='1', cpei_status.value, cpei_status.value)) as `Status value`
13
 ,cpedate_from.value as `Special from`
14
 ,cpedate_to.value as `Special to`
15
16
from catalog_product_entity_decimal as cped
17
left join catalog_product_entity as cpe on cped.entity_id=cpe.entity_id
18
left join catalog_product_entity_decimal as cped_price on cped.entity_id=cped_price.entity_id
19
 and cped.store_id=cped_price.store_id
20
 and cped_price.attribute_id=60
21
 
22
left join store on cped.store_id=store.store_id
23
 
24
left join catalog_product_entity_varchar as name on cped.entity_id=name.entity_id
25
 and cped.store_id=name.store_id
26
 and name.attribute_id=56
27
 
28
left join catalog_product_entity_varchar as cpev_style on cped.entity_id=cpev_style.entity_id
29
 and cped.store_id=cpev_style.store_id
30
 and cpev_style.attribute_id=547
31
 
32
left join catalog_product_entity_int as cpei_status on cped.entity_id=cpei_status.entity_id
33
 and cped.store_id=cpei_status.store_id
34
 and cpei_status.attribute_id=80
35
 
36
left join catalog_product_entity_datetime as cpedate_from on cped.entity_id=cpedate_from.entity_id
37
 and cped.store_id=cpedate_from.store_id
38
 and cpedate_from.attribute_id=62
39
 
40
left join catalog_product_entity_datetime as cpedate_to on cped.entity_id=cpedate_to.entity_id
41
 and cped.store_id=cpedate_to.store_id
42
 and cpedate_to.attribute_id=63
43
44
where cped.attribute_id=61
45
and cped.value is not null
46
47
order by cped.entity_id