Urgent !!! High score ask MySQL Query problems existing tables A and BA have A column bid that can be blank, corresponding to the primary key auto-incrementing column of Table B if you create A view, the view only displays data with bid not empty. The data in Table A with bid being empty cannot be displayed, it also shows that only one statement is used for data with null bid in Table A. Is there A way to achieve this? How can I write SQLcode? for example, urgent !!! High score ask MySQL Query questions
Existing tables A and B
Table A has A column bid that can be null, corresponding to the auto-incrementing column of the primary key of Table B.
If a view is created, the view only displays data with the bid not empty.
No data is displayed if the bid of Table A is empty.
Now I want to display the data with the bid of Table A being empty.
Is there a way to implement it with only one statement? How to Write
SQL code
For example: table A --------------- id bid name1 2 abc2 def3 1 ghi Table B ----------------- bid other1 aaa2 bbb if bid of A is associated with bid of B, the result is: ----------------- id bid name other1 2 abc aaa3 1 ghi above A table bid is empty and now the result I want is: ----------------- id bid name other1 2 abc aaa2 def3 1 ghi bbb
High Score
------ Solution --------------------
Search for join left and join right. I believe they can solve your problem.
------ Solution --------------------
Select a. id, a. bid, a. name, B. other from A a left join B B on a. bid = B. bid;