Home > database >  MariaDB weird problems after installation, please have a look great god!
MariaDB weird problems after installation, please have a look great god!

Time:10-05

Environmental Mac
Installation the brew
10.1.26 version 10.2 x
The problem:
Now have 2 table table A and table B
A table data 1000 B table 200
Select * from A left join B on Anderson, d=B.a _id
Results refer only to the 200 data. Only to find that both left join or right join or inner join is the same result.
To restore a database on the server after the query is normal. Great god grant instruction. How be to return a responsibility?

CodePudding user response:

Problem where the select * from A look

CodePudding user response:

reference 1st floor hongmei85 response:
A problem where the select * from A look at

This is no problem. The select * from 1000 A is right. The select * from B is 200

CodePudding user response:

The original poster is added to the WHERE? Practical advice posted statements,

CodePudding user response:

The
reference 3 floor ACMAIN_CHM response:
the original poster is added to the WHERE words? Practical advice posted statements,

No actual statement where clause for too much. Posted later

CodePudding user response:

 
Too many SELECT slightly
The FROM ` b_archives ` ` arc `
LEFT the JOIN ` t_system_param ` ` edu ` ON ` arc `. ` education `=` edu `. ` id `
LEFT the JOIN ` t_system_param ` ` sm ` ON ` arc `. ` studentMajor `=` sm `. ` id `
LEFT the JOIN ` t_system_param ` ` st ` ON ` arc `. ` studentType `=` st `. ` id `
LEFT the JOIN ` t_system_param ` ` ss ` ON ` arc `. ` studentState `=` ss `. ` id `
LEFT the JOIN ` t_system_param ` ` cl ` ON ` arc `. ` chineseLevel `=` cl `. ` id `
LEFT the JOIN ` t_system_param ` ON ` arc `. ` fundSource `=` t_system_param `. ` id `
LEFT the JOIN ` b_grades ` ON ` arc `. ` gradesID `=` b_grades `. ` id `
LEFT the JOIN ` b_college ` ON ` b_grades `. ` college `=` b_college `. ` id `
LEFT the JOIN ` v_dormitory ` ON ` v_dormitory `. ` archivesID `=` arc `. ` id `

Question basic position to decide. Actually remove v_dormitory query result is normal. V_dormitory is a SQL view is as follows:
 
Select a
The from ` b_dormitory `
Where
` b_dormitory `. ` ` id in (select Max (` b_dormitory `. ` id `) from ` b_dormitory ` group by ` b_dormitory `. ` archivesID `)

B_dormitory against a archivesID have multiple data in the table. Only take b_dormitory. Id. Therefore increased an intermediate table to determine each archivesID corresponds to only one b_dormitory

Question:
Have to add middle table? Why there is no such a situation before on the server? In the machine.


  • Related