GithubHelp home page GithubHelp logo

Comments (1)

badrecover avatar badrecover commented on July 28, 2024

query14.sql 中包含了两个查询,前一个查询是正常的,后一个查询的语句有问题,删除后一个查询即可;
query14.sql的第二个查询及query58.sql中,的失败均因date_dim表的子查询返回了多条记录,加上limit 1即可;
mysql> select d_week_seq
-> from date_dim
-> where d_year = 1999 + 1
-> and d_moy = 12
-> and d_dom = 3;
+------------+
| d_week_seq |
+------------+
| 5266 |
| 5266 |
+------------+
2 rows in set (0.02 sec)

mysql>

(select 'store' channel, i_brand_id,i_class_id,i_category_id,
sum(ss_quantityss_list_price) sales, count() number_sales
from store_sales
,item
,date_dim
where ss_item_sk in (select ss_item_sk from cross_items)
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_week_seq = (select d_week_seq
from date_dim
where d_year = 1999 + 1
and d_moy = 12
and d_dom = 3 limit 1)
group by i_brand_id,i_class_id,i_category_id
having sum(ss_quantity*ss_list_price) > (select average_sales from avg_sales)) this_year

from doris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.