联合查询两表中未关联的数据

作者: 浊酒心跳 分类: Mysql 发布时间: 2020-11-03 17:15 阅读: 2008

两表中有共同的字段orderId
表1     表2
1         1
2         2
3         3
4
5


想得到4和5的值,那么有两种方法


方法1:select * from 表1 where orderId not in (select orderId from 表2)


方法2:select * from 表1 where not exists(select 1 from 表2 where 表1.orderId=表2.orderId)

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

Sue Sumsuma: Hello qing5277.com, We noticed you are only listed in 18 out of a possible 10k+ directories. You can view your ranking here: https://directoryregistar.info/qing5277.com?id=MTg= Get more traffic, leads and sales by having your business rank high on search engines. We've automated everything that we possibly could to make submitting your website a breeze. Visit us on https://directoryregistar.info and get submitted 10k+ directories. We have a promotional offer running an All Inclusive, One-Time Fee Of $79!
Douglas Freame: Hello qing5277.com, We noticed you are only listed in 18 out of a possible 10k+ directories. You can view your ranking here: https://directoryregistar.info/qing5277.com?id=MTg= Get more traffic, leads and sales by having your business rank high on search engines. We've automated everything that we possibly could to make submitting your website a breeze. Visit us on https://directoryregistar.info and get submitted 10k+ directories. We have a promotional offer running an All Inclusive, One-Time Fee Of $79!
Karolin Braine: Wocaro is a ending its lead provider service at the end of the year. We have made all 365 million leads available for a once off fee of $15. You can view the samples here: https://wocaro.com/samples And go to our homepage to get instant access Wocaro.com
Fidelia Halse: Hello qing5277.com, We noticed you are only listed in 18 out of a possible 10k+ directories. You can view your ranking here: https://getlisted.directory/qing5277.com?id=MTg= Gift your business this Christmas by submitting your website to 10K+ directories on getlisted.directory. Get more traffic, leads and sales by having your business rank high on search engines. Never has it been easier to promote your website. We've automated everything that we possibly could to make submitting your website a breeze. Visit us on https://getlisted.directory and get submitted 10k+ directories. We have a festive promotional offer for an All Inclusive, One-Time Fee Of $49!
Cornell Castleberry: Hello, did you know that there are 241,120 internet directories in the world. These websites are what drive traffic to YOUR business. Want more traffic? Want more Sales? We can help - today. Your website qing5277.com is listed in only 81 of these directories. Get more traffic for your Global audience. Our automated system adds your website to all of the directories. You can find it here: getlisted.directory/qing5277.com Act today, and we will expedite your listings and waive the processing charge! We have a special going on. Use "FRIENDS" on checkout for a 50% discount valid today.
Emil Stingley: Convert qing5277.com to an app with one click! 80% of users browse websites from their phones. Have the App send out push notifications without any extra marketing costs! MakeMySiteMobile.com
Desmond Zajac: Your go-to source for leads. We can provide business to business and business to consumer leads, custom-tailored to your needs. CustomDatabases.org
Imogen Willason: Hello, from CustomData.info we are a provider of unique databases that could help your business. Please visit us at CustomData.info to see if we can help you. Regards, Imogen
Jan Kovach: Hello. It is with sad regret to inform you TopDataList.com is shutting down. We have made all our databases available for you for a once off fee. Visit us on TopDataList.com
Jon Huitt: ZippyLeads.org is running an easter special till the 18th of April. Get all the leads you need for your company with our easter special.
Johan Fourie: Hello. My name is Johan Fourie and I am looking to sell DataList.biz. We are a data company that has been in the industry for 12 years. We do around $170k/year in revenue. 1) I am looking to sell 50% of the business for $5k. 2) It would be helpful if you are knowledgeable about the Data Business. 3) I am looking for someone that is willing to take over administration, support, client relations. 4) I will continue to do the marketing for new products. 5) You will accept all future income and pay me from it. Please contact me on WhatsApp +27 72 280 1952 or my personal email: johanfourieinc@gmail.com if you are interested in this and we can have a call. Regards, Johan Fourie
Florencia Focken: It is with sad regret to inform you DataList.biz is shutting down on 31 March 2022. We have made available databases per country for all companies available.. You can view our samples and download databases instantly on our website DataList.biz
Marcelino Crombie: Hi, I am interested in some of your products. Please give me a call on +1 304-873-4360
Rozella Bottoms: Hello, It is with sad regret to inform you that DataList.biz is shutting down. We have made all our databases available for you at a one-time fee. You can visit us on DataList.biz Regards. Rozella