Home > database >  A list of fields associated with another table field values
A list of fields associated with another table field values

Time:04-10

There are two table, A table, there are fields: id, a1, a2, a3,... ; B table, there are fields: id, the column, the name,


How to check A, b, c corresponds to A table of values

CodePudding user response:

Pray god help MySQL query

CodePudding user response:

The column can be repeated, not can't repeat, you first table column B turned, and then related queries

CodePudding user response:

 
The select B.n ame,
(case biggest olumn
When 'a1' then A.a 1
When 'a2' then A.a 2
When 'a3' then A.a 3
The else 0
End value
From A, B where Anderson, d=B.i d
  • Related