Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:48:01+00:00 2026-05-23T06:48:01+00:00

This is the edited question with full problem. Following is the table structure. (Only

  • 0

This is the edited question with full problem. Following is the table structure. (Only necessary columns are shown below.)

Table Name: tblQualificationMaster.

Qualiid  QualiName
-------  ---------
1        S.S.C  
2        H.S.C  
3        B.Sc  
4        M.C.A  
5        M.Sc(IT)  
6        B.E  
7        M.B.A  
8        B.Com  
9        M.E  
10       C.S  
12       M.Com

Table Name: tblAppResumeMaster.

AppId  FirstName  LastName  TotalExpYears  TotalExpMonths  
-----  ---------  --------  -------------  --------------
1      Rahul      Patel     7              0  
2      Ritesh     Shah      0              0  
3      Ajay       shah      7              6  
4      Ram        Prasad    7              6  
5      Mohan      Varma     5              0  
6      Gaurav     Kumar     8              0  

Table Name: tblAppQualificationDetail. (For better reading I am writing comma separated value for all rows except first row but in my database all values are stored like for appid=1. i.e one row for each qualificationid.)

Appid  QualiId  
-----  -------
1      1  
1      2  
1      3  
1      4  
2      1,2,3  
3      1,2,6  
4      1,2,3,5  
5      1,2,3,4  
6      1,2,6,9  

Table Name: tblVacancyMaster

VacId  Title           Criteria  Req.Exp  KeySkills
-----  --------------  --------  -------  ---------------
1      Programmer      4,5,6     4        .net,java,php
2      TL              4,5       3        .net,java,php
3      Project Mngr.   4,6,9     4        .net,java,php,sql
4      Java Developer  4,5,6     0        java,oracle,sql
5      Manager         7,9       7        bussiness management
6      Supervisior     3,8       3        marketing
7      PHP Developer   4,5       0        php,mysql,send

Now based on this detail I want to create view which should have following fields. (It is shown for VacId=1 but I need this for all vacancies so that I can fire where clause on this view like select * from view where VacId=3.)

AppId  FirstName  LastName  QualiName  QualiId  TotalExp  VacId  VacTitle
-----  ---------  --------  ---------  -------  --------  -----  ----------
1      Rahul      Patel     M.C.A      4        7         1      Programmer
3      Ajay       Shah      B.E.       6        7         1      Programmer
5      Mohan      Verma     M.C.A      4        5         1      Programmer
6      Gaurav     Kumar     B.E        6        8         1      Programmer
6      Gaurav     Kumar     M.E        9        8         1      Programmer

This view shows AppId 1,3,5 and 6 are eligible for vacancy 3 but it shows duplicate entry for app 6. How can I get unique records?

I may be wrong in database design because this is my first project and I am learning database, so let me know and correct if something goes against database standards.

My previous query
(Note: Earlier I was using one intermediate table tblVacancyCriteriaDetail which was having columns VacId and QualiId and my table tblVacancyMaster was not having column criteria)

select
  ARM.AppId,
  ARM.AppFirstName,
  ARM.AppLastName,
  ARM.AppMobileNo,
  AQD.QualiId,
  VacQualiDetail.QualiName,
  ARM.AppEmailId1,
  VacQualiDetail.VacID,
  ARM.TotalExpYear,
  VacQualiDetail.VacTitle,
  VacQualiDetail.DeptId,
  VacQualiDetail.CompId,
  CM.CompName  
from
  tblAppResumeMaster ARM,
  tblAppQualificationDetail AQD,
  tblCompanyMaster CM,
  (
    select
      VM.VacID,
      VM.VacTitle,
      VM.CompId,
      VM.DeptId,
      vcd.QualificationID,
      QM.QualiName,
      VM.RequiredExperience as Expe
    from
      tblVacancyCriteriaDetail VCD,
      tblVacancyMaster VM,
      tblQualificationMaster QM
    where VCD.VacID=VM.VacID
      and VCD.QualificationID=QM.QualificationId
      and VM.Status=0
  ) as VacQualiDetail
where AQD.AppId=arm.AppId
  and aqd.QualiId=VacQualiDetail.QualificationID
  and ARM.TotalExpYear>=Expe
  and cm.CompId=VacQualiDetail.CompId
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:48:02+00:00Added an answer on May 23, 2026 at 6:48 am
    create view vAppList as
    select AppId, 
           FirstName, 
           LastName, 
           QualiName, 
           Qualiid, 
           TotalExpYears, 
           VacId, 
           Title
    from (select ARM.AppId,
                 ARM.FirstName,
                 ARM.LastName,
                 QM.QualiName,
                 QM.Qualiid,
                 ARM.TotalExpYears,
                 VM.VacId,
                 VM.Title,
                 row_number() over(partition by ARM.AppId, VM.VacId order by QM.Qualiid) as rn
          from tblAppResumeMaster as ARM
            inner join tblAppQualificationDetail as AQD
              on ARM.AppId = AQD.Appid
            inner join tblQualificationMaster as QM
              on AQD.QualiId = QM.Qualiid  
            inner join tblVacancyMaster as VM
              on  ','+VM.Criteria+',' like '%,'+cast(QM.Qualiid as varchar(10))+',%'    
         ) as V
    where V.rn = 1
    

    The sub query will have duplicate when one applicant matches more then one qualification. In that case QualiName will have the value for the lowest Qualiid.

    If you go back to use tblVacancyCriteriaDetail, which I think you should, the view would look like this.

    create view vAppList as
    select AppId, 
           FirstName, 
           LastName, 
           QualiName, 
           Qualiid, 
           TotalExpYears, 
           VacId, 
           Title
    from (select ARM.AppId,
                 ARM.FirstName,
                 ARM.LastName,
                 QM.QualiName,
                 QM.Qualiid,
                 ARM.TotalExpYears,
                 VM.VacId,
                 VM.Title,
                 row_number() over(partition by ARM.AppId, VM.VacId order by QM.Qualiid) as rn
          from tblAppResumeMaster as ARM
            inner join tblAppQualificationDetail as AQD
              on ARM.AppId = AQD.Appid
            inner join tblQualificationMaster as QM
              on AQD.QualiId = QM.Qualiid
            inner join tblVacancyCriteriaDetail as VCD    
              on QM.Qualiid = VCD.QualiID
            inner join tblVacancyMaster as VM
              on  VCD.VacId = VM.VacId
         ) as V
    where V.rn = 1     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edited this question because of my bad examples.. Here is my updated question: Would
I edited this question after i found a solution... i need to understand why
Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
I have edited this question to make it easier to understand. I have an
Note: I edited this question to make it easier for other people with the
EDITED QUESTION: I have 2500 rows x 100 columns data in variable named avg_data_models.
Hi this question or problem i have its very hard i have search and
This is a sample (edited slightly, but you get the idea) of my XML
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.