Home > database >  Consult a great god, and how to judge a SQL table of two field data at the same time, there is anoth
Consult a great god, and how to judge a SQL table of two field data at the same time, there is anoth

Time:04-30

Listed in table a station and cause two field data, I think in the decision table in table b a station and the cause of both field data exist, there is no wrote in table b, thank you

CodePudding user response:

Column turned after comparison table b, there is no insert

CodePudding user response:

 
Insert into table b (station, cause)
The select a.s tation, a.c ause
A. the from list a
Left the join table b b
On a.s tation=b.s tation
And a.c ause=biggest ause
Where b.s tation is null
  • Related