Home > database >  Consult the SQL statement, how to use the like the field during the course of two tables, to pick up
Consult the SQL statement, how to use the like the field during the course of two tables, to pick up

Time:09-30

Such as I have 2 tables A and B, B has A field in the detail of the query result contains A field of several A content of the code, how to bring up contain this content? The detail content is: & lt; Company name="A company" id="487033" & gt;

CodePudding user response:

In what kind of data, to what kind of results, for example, to understand what do you want

CodePudding user response:

Instr (b.d etail, a.c ode) & gt; 0

CodePudding user response:

reference 1st floor Diza1986 response:
what kind of data in the case, what kind of results, for example, to understand how do you want to

Is the table B DELTAIL id in all out

CodePudding user response:

reference 1st floor Diza1986 response:
what kind of data in the case, what kind of results, for example, to understand how do you want to

Above that seems to be wrong, is in A table to find out in the code appears in the table B

CodePudding user response:

 
The select b.i d, a.c ode
From a, b
Where instr (b.d etail, '"' | | a.c ode | | '"') & gt; 0

CodePudding user response:

reference 5 floor Diza1986 reply:
 
The select b.i d, a.c ode
From a, b
Where instr (b.d etail, '"' | | a.c ode | | '"') & gt; 0

Not the id in the table B, but B table detail in the light of the value of the id is A table in the code

CodePudding user response:

refer to 6th floor ClaudiaChoo response:
Quote: refer to the fifth floor Diza1986 reply:

 
The select b.i d, a.c ode
From a, b
Where instr (b.d etail, '"' | | a.c ode | | '"') & gt; 0

Not the id in the table B, but B table detail in the light of the value of the id is A table in the code


This result is B table A table of the code in each detail, take A b.i d which is in order to know, can put the b.d etail also out, after the select plus

CodePudding user response:

refer to 7th floor Diza1986 response:
Quote: refer to the sixth floor ClaudiaChoo response:

Quote: refer to the fifth floor Diza1986 reply:

 
The select b.i d, a.c ode
From a, b
Where instr (b.d etail, '"' | | a.c ode | | '"') & gt; 0

Not the id in the table B, but B table detail in the light of the value of the id is A table in the code


This result is B table A table of the code in each detail, take A b.i d which is in order to know, can put the b.d etail also out, just after the select plus

Yes, it is like that, thanks to the great god
  • Related