Two similar SQL-like query results that were never noticed before

Source: Internet
Author: User

Two similar SQL-like query results that were never noticed before



Select A.*, case when X.resno was null then 0 else 1 end as Isown from Prm_res a

Left Join

(select B.resno from Prm_res b

INNER JOIN Prmg_role_res C on B.resno=c.resno

INNER JOIN Prmg_acct_role D on D.roleno=c.roleno and d.acct=1

) as X

On A.resno=x.resno where a.sysno=1;

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/99/C2/wKiom1lL6wOQyyVXAACBSqLeMcg654.png-wh_500x0-wm_ 3-wmp_4-s_1561242372.png "title=" Qq20170623000452.png "alt=" Wkiom1ll6woqyyvxaacbsqlemcg654.png-wh_50 "/>


Select A.*, case when X.resno was null then 0 else 1 end as Isown from Prm_res a

Left Join

(select B.resno from Prm_res b

INNER JOIN Prmg_role_res C on B.resno=c.resno

INNER JOIN Prmg_acct_role D on D.roleno=c.roleno and d.acct=1

) as X

On A.resno=x.resno and a.sysno=1;

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/99/C2/wKiom1lL6xTjdnVLAACIy6VHngw446.png-wh_500x0-wm_ 3-wmp_4-s_1524035685.png "title=" Qq20170623000518.png "alt=" Wkiom1ll6xtjdnvlaaciy6vhngw446.png-wh_50 "/>


Who knows what the situation is? Welcome message

This article is from the lava blog, so be sure to keep this source http://lavasoft.blog.51cto.com/62575/1941135

Two similar SQL-like query results that were never noticed before

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.