Home > database >  Two different tables using SQL view query data
Two different tables using SQL view query data

Time:09-16



Two tables, ptype, btype, view the output full table ptype data, read out table btype field FullName, which means that gold may become lotion and zhejiang in SAN hua pharmaceutical co., can be realized with a view?

CodePudding user response:

Field is the same with the union

CodePudding user response:

reference 1st floor sinat_28984567 response:
the field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

CodePudding user response:

refer to the second floor mjb115889 response:
Quote: refer to 1st floor sinat_28984567 response:

The field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

Such as the first table reads an id
The second table reads a name
The two also need this show together? The field name rules into a line

CodePudding user response:

reference sinat_28984567 reply: 3/f
Quote: refer to the second floor mjb115889 response:

Quote: refer to 1st floor sinat_28984567 response:

The field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

Such as the first table reads an id
The second table reads a name
The two also need this show together? The field name rules into a line


The value of the id and the name is not the same as
In table 2 in table 1, id, name, id, name
1, 3, wang xiao li
2, 4, xiao Ming wang
I want the display effect is, shown in table 1 1, wang, wang matches on the same line, it can be shown?

CodePudding user response:

You this two tables associated fields is which?

CodePudding user response:

reference 4 floor mjb115889 response:
Quote: reference sinat_28984567 reply: 3/f

Quote: refer to the second floor mjb115889 response:

Quote: refer to 1st floor sinat_28984567 response:

The field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

Such as the first table reads an id
The second table reads a name
The two also need this show together? The field name rules into a line


The value of the id and the name is not the same as
In table 2 in table 1, id, name, id, name
1, 3, wang xiao li
2, 4, xiao Ming wang
I want the display effect is, shown in table 1 1, wang, wang matches on the same line, it can be shown?

Can show that match what are the rules in the same line? Words have the same in the two name? If table 2 cnooc king?

CodePudding user response:

With the union (union all) is OK

CodePudding user response:

refer to 6th floor sinat_28984567 response:
Quote: refer to 4th floor mjb115889 response:

Quote: refer to the third floor sinat_28984567 response:

Quote: refer to the second floor mjb115889 response:

Quote: refer to 1st floor sinat_28984567 response:

The field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

Such as the first table reads an id
The second table reads a name
The two also need this show together? The field name rules into a line


The value of the id and the name is not the same as
In table 2 in table 1, id, name, id, name
1, 3, wang xiao li
2, 4, xiao Ming wang
I want the display effect is, shown in table 1 1, wang, wang matches on the same line, it can be shown?

Can show that match what are the rules in the same line? Words have the same in the two name? If table 2 cnooc king?


The value of id, the name is different, only the field name is the same, must have the same value can match together?

CodePudding user response:

refer to 7th floor McXhh2005 response:
with the union (union all) is OK


The union this table field is listed, I this is not the same

CodePudding user response:

reference 5 floor keueng reply:
you the table which is associated fields?


Two table join must have associated fields?

CodePudding user response:

CodePudding user response:

references to the tenth floor mjb115889 response:
Quote: refer to the fifth floor keueng reply:

You this two tables associated fields is which?


Two table join must have associated fields?


Not must have associated fields, but that is the product of Descartes, it is hard to imagine what the result set USES,

CodePudding user response:

reference 4 floor mjb115889 response:
Quote: reference sinat_28984567 reply: 3/f

Quote: refer to the second floor mjb115889 response:

Quote: refer to 1st floor sinat_28984567 response:

The field is the same with the union can

I'm not familiar with this table field
If the field is not the same? Also can match it?

Such as the first table reads an id
The second table reads a name
The two also need this show together? The field name rules into a line


The value of the id and the name is not the same as
In table 2 in table 1, id, name, id, name
nullnullnullnull
  • Related