Home > database >  Modify the SQL statement
Modify the SQL statement

Time:10-25

A SQL statement

SELECT * FROM (SELECT i.R ECEIVE_NUMBER and i.I TEM_CODE, p.I DCARD_NO, p.N AME, i.B USINESS_OBJECT_TYPE, f.D OCUMENT_NAME, f.F ILE_PATH, f.F ILE_NAME
The FROM
ACCEPT_BUSINESS_INDEX I LEFT JOIN ACCEPT_PERSON p ON i.B USINESS_OBJECT_CODE=p. EQ_ID LEFT JOIN ACCEPT_BUSINESS_FILE f ON i.B SNUM=f.B SNUM
WHERE
I.B USINESS_OBJECT_CODE=p. EQ_ID AND i.B SNUM=f.B SNUM AND (i. TATE='99' OR i. TATE='100') AND f.T YPE='1' AND i.R ECEIVE_NUMBER NOT IN (SELECT i.R ECEIVE_NUMBER FROM ACCEPT_MATERIAL_DOSSIER m WHERE i.R ECEIVE_NUMBER=m.B USINESS_OBJECT_CODE)) WHERE ROWNUM & lt;=200


The results for the


Now want to repeat the i.R ECEIVE_NUMBER remove what should change

CodePudding user response:

The column of repetition of take out, the back of the column values, how to deal with?

CodePudding user response:

At the back of the preserved

CodePudding user response:

Behind the first few columns to repeat can take out, three columns

CodePudding user response:

This should be called polymerization

The select RECEIVE_NUMBER ITEM_CODE, IDCARD_NO,
Listagg (NAME) within group (order by 1),
Listagg (BUSINESS_OBJECT_TYPE) within group (order by 1) from the TAB group by RECEIVE_NUMBER, ITEM_CODE, IDCARD_NO

CodePudding user response:

I can't, the result is not

reference 4 floor nayi_224 response:

this should call polymerization
The select RECEIVE_NUMBER ITEM_CODE, IDCARD_NO,
Listagg (NAME) within group (order by 1),
Listagg (BUSINESS_OBJECT_TYPE) within group (order by 1) from the TAB group by RECEIVE_NUMBER, ITEM_CODE, IDCARD_NO

CodePudding user response:

Forgot to say, RECEIVE_NUMBER repeat this field because a RECEIVE_NUMBER corresponding to multiple files, so would repeat, actually exterior-interior RECEIVE_NUMBER field is not repeated

CodePudding user response:

The column of repetition of take out, the back of the column values, how to deal with?

CodePudding user response:

refer to 7th floor AHUA1001 response:
this column repeat, at the back of the column values, how to deal with?


Behind the three columns, the first few columns duplicate can be removed
  • Related