Results 1 to 2 of 2

Thread: Joins

  1. #1
    Join Date
    Dec 1969

    Default Joins

    I have 3 tables<BR>Employee_master(Emp_id,Emp_name) <BR>records<BR>----------------------<BR>1 Tom<BR>2 Jerry<BR>3 Johnny <BR><BR>EMPloyee_details(EMP_id,det1,det2,det3,Cou ntry_id)<BR>Records<BR>----------------------------------------------<BR>1 ABC BBC CA1 1<BR>1 CCC DD1 ABC 1<BR>1 A11 C2G KRC 1<BR>2 AAA BBB CCC 2<BR>2 ASDF ASDF ASDF 1 <BR><BR>Country_master(country_id,country_name)<BR ><BR>Records<BR>-------------------------------------<BR>1 Japan<BR>2 Korea<BR>3 China<BR>4 America <BR><BR>I am struck up in building a query which should fulfil these....<BR><BR>Query should return unique Emp_id and if in the emp_details table in country_id(which means the countries emp visited)if Country_id is same for all the records for that particular emp_id it should display the country Name and if its more than one country for that particular emp_id it should display "Many" <BR><BR>Is this possible in SQL Server??<BR>

  2. #2
    Join Date
    Dec 1969

    Default Hey!

    this is homework,isn&#039;t it??<BR><BR>I&#039;ve answered this exact same question some time ago for someone else....

Posting Permissions

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