forked from agirish/tpcds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
query41.sql
66 lines (66 loc) · 3.71 KB
/
query41.sql
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- start query 41 in stream 0 using template query41.tpl
SELECT Distinct(i_product_name)
FROM item i1
WHERE i_manufact_id BETWEEN 765 AND 765 + 40
AND (SELECT Count(*) AS item_cnt
FROM item
WHERE ( i_manufact = i1.i_manufact
AND ( ( i_category = 'Women'
AND ( i_color = 'dim'
OR i_color = 'green' )
AND ( i_units = 'Gross'
OR i_units = 'Dozen' )
AND ( i_size = 'economy'
OR i_size = 'petite' ) )
OR ( i_category = 'Women'
AND ( i_color = 'navajo'
OR i_color = 'aquamarine' )
AND ( i_units = 'Case'
OR i_units = 'Unknown' )
AND ( i_size = 'large'
OR i_size = 'N/A' ) )
OR ( i_category = 'Men'
AND ( i_color = 'indian'
OR i_color = 'dark' )
AND ( i_units = 'Oz'
OR i_units = 'Lb' )
AND ( i_size = 'extra large'
OR i_size = 'small' ) )
OR ( i_category = 'Men'
AND ( i_color = 'peach'
OR i_color = 'purple' )
AND ( i_units = 'Tbl'
OR i_units = 'Bunch' )
AND ( i_size = 'economy'
OR i_size = 'petite' ) ) ) )
OR ( i_manufact = i1.i_manufact
AND ( ( i_category = 'Women'
AND ( i_color = 'orchid'
OR i_color = 'peru' )
AND ( i_units = 'Carton'
OR i_units = 'Cup' )
AND ( i_size = 'economy'
OR i_size = 'petite' ) )
OR ( i_category = 'Women'
AND ( i_color = 'violet'
OR i_color = 'papaya' )
AND ( i_units = 'Ounce'
OR i_units = 'Box' )
AND ( i_size = 'large'
OR i_size = 'N/A' ) )
OR ( i_category = 'Men'
AND ( i_color = 'drab'
OR i_color = 'grey' )
AND ( i_units = 'Each'
OR i_units = 'N/A' )
AND ( i_size = 'extra large'
OR i_size = 'small' ) )
OR ( i_category = 'Men'
AND ( i_color = 'chocolate'
OR i_color = 'antique' )
AND ( i_units = 'Dram'
OR i_units = 'Gram' )
AND ( i_size = 'economy'
OR i_size = 'petite' ) ) ) )) > 0
ORDER BY i_product_name
LIMIT 100;