Create or replace view V_WTK_ALL
Select a. id, o. short as FindDeptName, u. realname as FindUserName, f. name as FindWay, o1.short as ProblemAtDeptName,
Z. name as szzz,. yhnr, s. name as SSZY, k. name as kind, w. name as whhg,. zgcs,. zgfzr,. plandate,. finishdate,
U1.realname as jdr, u2.realname as fxr, a. yqzt, a. yqdate, a. wtkzt
From WTK a, ORGANIZATION o, ORGANIZATION o1, OPERATORS u, OPERATORS u1, OPERATORS u2, Kind k, Findway f, SPfield s, SZZZ z, WHHG w
Where. finddeptid = o. id (+) and. problematdeptid = o1.id (+) and. finduserid = u. id (+) and. jdr = u1.id (+) and. fxr = u2.id (+)
And. kindid = k. id (+) and. findwayid = f. id (+) and. spfieldid = s. id (+) and. szzid = z. id (+) and. whhgid = w. id (+)
There are two tables
Table1
User_id user_name user_pss
1 aaa
2 bbb B
3 ccc c
Table 2
User_id user_power
1 111000
2 000111
Query using SQL statements
Normal status:
Select table1.user _ id,
Table1.user _ name,
Table2.user _ power
From table1, table2
Where table1.user _ id = table2.user _ id
However, only two pieces of data are retrieved:
User_id user_name user_power
1 aaa 000111
2 bbb 111000
Enter the text you want to convert,
Click the button below to perform online conversion.
Select table1.user _ id, table1.user _ name, table2.user _ power
From table1, table2
Where table1.user _ id (+) = table2.user _ id
The following result is displayed:
User_id user_name user_power
1 aaa 000111
2 bbb 111000
3 ccc (null)
Note: The left or right join query specifies the table data to be queried. The default value (Left or Right join is not specified) is the data with key columns in both tables.
Internal join is a record of the corresponding values of the connected fields in both tables before data can be retrieved.
The left join means that data can be retrieved as long as there are records in the left table, and some records on the right can be retrieved only when there are records in the left table.
Right join: data can be retrieved as long as there are records in the right table.