Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of and and or in mysql federated query

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "mysql joint query in the use of and and or", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "the use of and and or in mysql joint query"!

Demand environment:

Function: resume search

Requirements: full-time, part-time, temporary workers and interns can be selected among the job search types, but there is only one resume. List all the resumes that meet any of the requirements.

Obstacle: any condition of or is that TRUE stops judging, and and condition takes intersection.

SELECT

T_person_info.personid

T_person_info.personname

T_person_info.sex

T_person_edu.education

T_person_edu.school

Tweeperson.edu.`roomt`

Tweeperson.edu.`to`

FROM

T_person_info

LEFT JOIN t_person_edu ON t_person_edu.personid = t_person_info.personid

WHERE 1 # 1

AND (type = 3 OR type = 1)

AND (company = 222OR company = 'Hubei Index')

If you look at lines 14 and 15, the or condition in parentheses will be executed first, and then the nearest condition on the left side of the parenthesis will be executed, which is suitable for merging the same field.

Thank you for reading, the above is the content of "the use of and and or in mysql joint query". After the study of this article, I believe you have a deeper understanding of the use of and and or in mysql joint query, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report