select customer_id,customer_name,customer_type,from customer_code GROUP BY customer_id;

解决方案 »

  1.   

    不好意思,刚才一着急漏掉了一点东西!!对不起
    select customer_id,customer_name,customer_type,sum(customer_id) from customer_co
    de GROUP BY location_id;
     
      

  2.   

    select customer_id,customer_name,customer_type,sum(customer_id) 
    from customer_code 
    GROUP BY customer_id,customer_name,customer_type;
      

  3.   

    select customer_id,customer_name,customer_type,sum(customer_id) 
    from customer_code 
    GROUP BY customer_id,customer_name,customer_type;
      

  4.   

    select location_id,customer_id,customer_name,
    customer_type,sum(customer_id) 
    from customer_code 
    GROUP BY location_id,customer_id,customer_name,customer_type;
      

  5.   

    疑问:customer_id应该是顾客id号,对他取sum是何用意呢?
    还有贴主能不能把你要写的sql语句的意思说一下,才方便帮你啊。
      

  6.   

    还是到ORACLE下个文档看看吧,很基础的.
      

  7.   

    select customer_id,customer_name,customer_type,tot_id
    from customer_code 
    where rowid in(select min(rowid),sum(customer_id) as tot_id from customer_code GROUP BY customer_id);
      

  8.   

    select customer_id,customer_name,customer_type
    from customer_code 
    group by customer_id,customer_name,customer_type
      

  9.   

    In a simple GROUP BY clause, you can use either the upper or lower form of
    expression list:
    SELECT department_id, MIN(salary), MAX(salary)
    FROM employees
    GROUP BY department_id, salary;
    SELECT department_id, MIN(salary), MAX(salary)
    FROM employees
    GROUP BY (department_id, salary);
    In ROLLUP, CUBE, and GROUPING SETS clauses of GROUP BY clauses, you can
    combine individual expressions with sets of expressions in the same expression list.
    The following example shows several valid grouping sets expression lists in one
    SQL statement:
    SELECT
    prod_category, prod_subcategory, country_id, cust_city, count(*)
    FROM products, sales, customers
    WHERE sales.prod_id = products.prod_id
    AND sales.cust_id=customers.cust_id
    AND sales.time_id = ¡¯01-oct-00¡¯
    AND customers.cust_year_of_birth BETWEEN 1960 and 1970
    GROUP BY GROUPING SETS
    (
    (prod_category, prod_subcategory, country_id, cust_city),
    (prod_category, prod_subcategory, country_id),
    (prod_category, prod_subcategory),
    country_id
    );