Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Server TSQL query help

$
0
0

Hi Spiceheads,

Can anyone of you please help me to rewrite the logic or give an idea on how to approach the below situation

We have database called SCH_PROG and three tables.

1.Schooldetailstable

2.tblStatCousedetails

3.tblTopSchoolGroup

****I have attached both the queries to create the Database and the Query to be tuned ***********

We have a table called Schooldetailstable with schools as records, some schools are part of one group called GSG some are not part of this group.

Each schools have different programs entered in the table called tblstatcoursedetails

Scenario

When a teacher enter a program(record) in one of the schools in the tblstatcoursedetails.

If the school belongs to the GSG group

When we execute the attached query each school in the GSG group will get the program(record) updated.

Issue

The records will get updated only if the...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>