Home > Back-end >  This form, I want to find out tagid equals 8 and is equal to 4, how to write
This form, I want to find out tagid equals 8 and is equal to 4, how to write

Time:10-13

Is this form, I want to find out tagid equals 8 and is equal to 4, how to write ah

CodePudding user response:

Select * from table name where tag_id=8 or tag_id=4

CodePudding user response:

reference 1st floor weixin_43869905 response:
select * from table name where tag_id=8 or tag_id=4

No, to meet equals 8 and 4 at the same time, use the or or the and saves courseid equals 7 found out

CodePudding user response:

If you demand wrong. Course_id equals 8 and tagid equals 4

CodePudding user response:

SELECT
Eight. Id,
Eight courseid,
Eight. Tag_id
The FROM
(
SELECT
*
The FROM
The table name
WHERE
Tag_id=8
Eight)
The JOIN (
SELECT
*
The FROM
The table name
WHERE
Tag_id=4
) four ON eight. Courseid=four. Courseid

CodePudding user response:

reference 4 floor weixin_43869905 response:
SELECT
Eight. Id,
Eight courseid,
Eight. Tag_id
The FROM
(
SELECT
*
The FROM
The table name
WHERE
Tag_id=8
Eight)
The JOIN (
SELECT
*
The FROM
The table name
WHERE
Tag_id=4
) four ON eight. Courseid=four. Courseid
you said is right
  • Related