The problem is as follows: {code...} The problem is as follows:
Create an APP interface to obtain the contact list, but the contact score is 0. administrator 1. bind user 2. friends and family 3. app friend, and then there is an im table with a corresponding im_id. When the contact is 0 and 1, im_id is returned. If it is 2 or 3, No. if we only return a result and there is no type condition, join is enough, but now there is a type difference. how can this be done?
Reply content:
The problem is as follows:
Create an APP interface to obtain the contact list, but the contact score is 0. administrator 1. bind user 2. friends and family 3. app friend, and then there is an im table with a corresponding im_id. When the contact is 0 and 1, im_id is returned. If it is 2 or 3, No. if we only return a result and there is no type condition, join is enough, but now there is a type difference. how can this be done?
Assume that the list of contacts obtained is a user table. You mean there is a contact type in this user table, right?
Since you say that you want to use join, there may be two tables, so there must be a connection between the two tables.
SELECT im. im_id WHERE user left join im ON user. im_id = im. im_id WHERE user. im_id IN (0, 1 );
Actually, I don't know how to understand it?
If it is sharded, adding a where limit is not enough. 0 0.
For exampleWHERE im. im_id IN (0, 1)