Case: Then.. The study of Oracle functions ....

Source: Internet
Author: User

SELECT A.areaname AS Level two place name from houses h,houses H2,
Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 and
H.houseslevel=2 and H2.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2;

SELECT * FROM areas
Select COUNT (h.houseslevel) as Total, count (H1.houseslevel) as the latest cumulative disk, COUNT (H2.houseslevel) as the latest cumulative required from houses h,houses h 1,houses H2 where H.houseslevel in (from) and h1.houseslevel=1 and h2.houseslevel=2;

Select COUNT (h.houseslevel) as total from houses H where h.houseslevel in
UNION ALL
Select COUNT (h.houseslevel) as disk from houses H where h.houseslevel=1
UNION ALL
Select COUNT (h.houseslevel) as disk from houses H where h.houseslevel=2;


Select
Count (h.houseslevel) as Total,
Count (case is h.houseslevel=1 then H.housesid end) into a disk,
Count (case if h.houseslevel=2 then H.housesid end) comparison disk
From houses H,areas a where h.areaid=a.areasid and h.houseslevel in

SELECT A.areaname AS Level two place name,
Count (A.houseid) as the latest cumulative effective number of unsold,
Count (H.houseslevel) as the latest cumulative required sell, COUNT (H2.houseslevel) as the latest cumulative disk from houses h,houses H2,
Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 and h.houseslevel=2 and H2.houseslevel =1 and A.areasid!=a.parentareasid and a.companysid=2;

SELECT A.areaname AS Level two place name from houses H,areas a WHERE h.areaid=a.areasid and A.areasid!=a.parentareasid

SELECT A.areaname AS Level two place name from areas a where a.areaname=

Select A.areaname AS Level two place name from areas a
where A.areaname in (select B.areaname from areas B GROUP by B.areaname have count (b.areaname) > 1)


Select B.areaname AS Level two place name, Count (b.areaname) as duplicate data from areas B GROUP by B.areaname have count (b.areaname) > 1

Select H.houseslevel from houses h where h.houseslevel=1;

Select A.areaname AS Level two place name from houses H,areas a where h.areaid=h.areaid and h.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2 and h.finalassessmentid=1;


Select A.areaname AS Level two place name,
Count (h.houseslevel) as Total,
Count (case is h.houseslevel=1 then H.housesid end) into a disk,
Count (case if h.houseslevel=2 then H.housesid end) comparison disk
From houses H,areas a where h.areaid=a.areasid and H.houseslevel in (all) and A.areasid!=a.parentareasid and a.companysid= 2 and H.finalassessmentid=1 and Flag1=1 Group by A.areaname;

Case: Then.. The study of Oracle functions ....

Related Article

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.