Last post Dec 02, 2014 05:13 AM by gimimex
Dec 02, 2014 04:15 AM|lathasekar|LINK
I have three tables Blocks, Floors, Flats.
In Blocks, No of Floors per Block is given.
In Floors, No of Flats per Floor is given.
In Flat, Flat No, Square Feet are given.
I want to find in which Floor, I need to create Flats. (I need OID,Floor No)
Pl suggest. Thanks in advance
Tables with Data given below.
Dec 02, 2014 05:13 AM|gimimex|LINK
count(a.OID) as QtyFlats,
o.NoOfFlats - count(a.OID) as QtyCreate
from Floors as o
left join Flats as a
on a.FloorsOID = o.OID
count(a.OID) < o.NoOfFlats
Hope this helps.