The SELECT CUST_CODE, CUST_NAME FROM CUST_CORP_INFO
Above is the query name and number
SELECT * FROM (SELECT to_char (2010 + floor (13) (rownum)/YY, substr (' 0 '| | to_char (mod) (rownum, 13), 2, 2) MM FROM DUAL CONNECT BY rownum
Known CUST_CORP_INFO have monthly data in the table, and now want to associate two tables, if the company has a month plan provided, display data, if not a month, only shows the years, the company name, company number,
XXX company, for example, in 2019 August 1 - all data provided by means of this plan, display the data, also have no, in September, only show in September 2019 and the company's name and number, the other fields empty,
Pray god help!
CodePudding user response:
Then in accordance with the extent of the date of each line, to find the company table in the corresponding data bai, date and company as a cartesian corporaCodePudding user response:
Right, now mainly, if not fill in any month plan it this month's data only show the customer name and number, the other is empty, the data is not in the databaseCodePudding user response:
Ask everybody to help! Help to do somethingCodePudding user response:
About the meaning, specific tables and fields to see the building actual situationSELECT *
The FROM (SELECT * FROM date table, table) t
LEFT the JOIN table
ON t.Y Lin Y=data tables. YY
AND t.M M=data tables. MM
AND t. company ID=data tables. ID;
CodePudding user response: