Database MySQL content supplement two

Source: Internet
Author: User
Tags dname

Multi-table query mysql support is SQL99 standard connection query, does not support Oracle Company's external connection query, but supports Oracle equivalent query, not equivalent query, self-connection query, subquery (as long as it is not an outer join (  +  ) are supported) Oracle also supports SQL99 standard connection queries 
Internal Connection--equivalent QuerySelectE.empno,e.ename,e.sal,d.dname fromEMP Einner Join dept Don E.deptno=D.deptno;--To put it simply: replace the comma in the Oracle Multi-table query syntax with the INNER join, where the query condition is placed after on, emphasizing that on the back is not just a join condition or a query condition--non-equivalent querySelectE.empno,e.ename,e.sal,s.grade fromemp Einner join Salgrade son e.sal>=s.losal and e.sal<=s.hisal; left OUTER join (right outer join--Right join)SelectD.deptno,d.dname,count (e.empno) fromDept dleft join EMP Eon D.deptno=E.deptnogroup by D.deptno, D.dname-- LEFT OUTER JOIN note that if you want to show all the data for that table, use that table as a base table , for example, to display unit 40th in the Dept table, so dept is the base table, the Oracle (+) instead.
filter null function in MySQL --ifnull (field name, desired value)--mysql no Nvl () function
string Connection --mysql in MySQL does not support '| | ' in Oracle " connection Symbol --mysql support for concat () connection functions in Oracle

Database MySQL content supplement two

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.