Hi Friends,
My problem with Inner join is ...
first i joined two tables and i got the result.
after that iam trying to join one more table its giving syn tax error in JOIN condition.
Here is the Query
[CODE=oracle]
SELECT School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Count(Level4Ite m.Level4ItemKey ) AS CountOfLevel4It emKey
FROM (School INNER JOIN Block ON School.SchoolKe y=Block.SchoolK ey) INNER JOIN Level4Item ON Block.BlockKey= Level4Item.Bloc kKey
GROUP BY
School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Block.BlockNumb er,
School.Active,
Level4Item.Acti ve
HAVING (((Block.BlockN umber)<>"EXT")
AND ((School.Active )=1)
AND ((Level4Item.Ac tive)=1))
ORDER BY
Count(Level4Ite m.Level4ItemKey ) DESC;
[/CODE]
This is working.
To this table i am trying to join one more. My problem is there are two tables called SCHOOL and SITE. SCHOOL table is having uprn, property name, sitekey and etc. and SITE table is having SiteKey, uprn, school name, AssetTypeKey Etc.....
I took sitekey is primary key and try to join, but its giving Join error.
The Query is
[CODE=oracle]
SELECT School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Count (Level4Item.Lev el4ItemKey) AS CountOfLevel4It emKey, Site.AssetTypeK ey
FROM ((School INNER JOIN Block ON School.SchoolKe y = Block.SchoolKey ) INEER JOIN Site ON School.SiteKey = Site.SiteKey) INNER JOIN Level4Item ON Block.BlockKey = Level4Item.Bloc kKey
GROUP BY
School.
UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Block.BlockNumb er,
School.Active,
Level4Item.Acti ve,
School.SiteKey
HAVING (((Block.BlockN umber)<>"EXT")
AND ((School.Active )=1)
AND ((Level4Item.Ac tive)=1))
ORDER BY
Count(Level4Ite m.Level4ItemKey ) DESC;[/CODE]
Please help me.
its urgent. iam not able to get this.
thanks in advance.
My problem with Inner join is ...
first i joined two tables and i got the result.
after that iam trying to join one more table its giving syn tax error in JOIN condition.
Here is the Query
[CODE=oracle]
SELECT School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Count(Level4Ite m.Level4ItemKey ) AS CountOfLevel4It emKey
FROM (School INNER JOIN Block ON School.SchoolKe y=Block.SchoolK ey) INNER JOIN Level4Item ON Block.BlockKey= Level4Item.Bloc kKey
GROUP BY
School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Block.BlockNumb er,
School.Active,
Level4Item.Acti ve
HAVING (((Block.BlockN umber)<>"EXT")
AND ((School.Active )=1)
AND ((Level4Item.Ac tive)=1))
ORDER BY
Count(Level4Ite m.Level4ItemKey ) DESC;
[/CODE]
This is working.
To this table i am trying to join one more. My problem is there are two tables called SCHOOL and SITE. SCHOOL table is having uprn, property name, sitekey and etc. and SITE table is having SiteKey, uprn, school name, AssetTypeKey Etc.....
I took sitekey is primary key and try to join, but its giving Join error.
The Query is
[CODE=oracle]
SELECT School.UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Count (Level4Item.Lev el4ItemKey) AS CountOfLevel4It emKey, Site.AssetTypeK ey
FROM ((School INNER JOIN Block ON School.SchoolKe y = Block.SchoolKey ) INEER JOIN Site ON School.SiteKey = Site.SiteKey) INNER JOIN Level4Item ON Block.BlockKey = Level4Item.Bloc kKey
GROUP BY
School.
UPRN,
School.SchoolNa me,
School.DfeeNumb er,
Block.BlockNumb er,
School.Active,
Level4Item.Acti ve,
School.SiteKey
HAVING (((Block.BlockN umber)<>"EXT")
AND ((School.Active )=1)
AND ((Level4Item.Ac tive)=1))
ORDER BY
Count(Level4Ite m.Level4ItemKey ) DESC;[/CODE]
Please help me.
its urgent. iam not able to get this.
thanks in advance.
Comment