Get rid from one column duplicate values in two column select

前端 未结 3 605
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 21:50

So, I`ve got two columns t1.NAME and t2.ITEMS, for each neme there can be more than one item assigned to it, so I want to select it like:

| NAME | ITEMS |
           


        
3条回答
  •  礼貌的吻别
    2020-12-21 22:22

    I usually do it in SQL*Plus and it is all about formatting your output.

    You could use BREAK ON column_name.

    For example,

    SQL> break on deptno
    SQL> SELECT deptno, ename FROM emp order by deptno;
    
        DEPTNO ENAME
    ---------- ----------
            10 CLARK
               KING
               MILLER
            20 JONES
               FORD
               ADAMS
               SMITH
               SCOTT
            30 WARD
               TURNER
               ALLEN
               JAMES
               BLAKE
               MARTIN
    
    14 rows selected.
    

提交回复
热议问题