complex query

Results 1 to 2 of 2

Thread: complex query

  1. #1
    Join Date
    Dec 1969

    Default complex query

    I have this MS SQL server database running with around 1 lac records. Below are the tables.<BR><BR>REGION_MASTER(REGION_ID,REGION_NAME )<BR>COUNTRY_MASTER(COUNTRY_ID,COUNTRY_NAME,REGION _ID)<BR>USER_MASTER(USER_ID,USER_NAME,REGION_ID,CO UNTRY_ID)<BR><BR>PROJECT_MASTER(PROJECT_ID,PROJECT _NAME,PROJECT_DESC,REGION_ID)<BR>PROJ_DETAILS(PROJ ECT_ID,FIRST_HALF,SECOND_HALF,COUNTRY_ID)<BR><BR>W hile creating a project users will select a region and country..I have 4 regions..Americas,Europe, APAC and Global. When a user selects Americas the countries in Americas will be listed when he selects europe the countries in that region will be listed and users can select the same and create the projects.<BR><BR>I have a region called Global in which all the countries(countries in Americas,europe and APAC) will be listed.<BR><BR>My problem now is, I need a query which should fetch:<BR><BR>Sum(FIRST_HALF) FOR project_master.REGION_ID=1 or project_masterregion_id=4 but users region_id=1

  2. #2
    Join Date
    Dec 1969

    Default RE: complex query

    What is this, homework?<BR><BR>This has to be the fifth time someone comes here with exact the same table layout.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts