Re: Eliminating Duplicated



"venkataramarao" <venkataramarao@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AC5F930E-5EE5-41B2-AB7B-C809082EF5C7@xxxxxxxxxxxxxxxx
I have 3 tables Employee (empno,name,city) , Emp-Pl (empno,noofleaves) ,
and
Emp-Cl (empno,noofleaves). Now i require the report in the following
format

Sample Data
employee
1 ravi kumar rajahmundry
2 ravindra kakinada

emp-pl emp-cl
empno noofleave empno noofleave
1 2 1 4
1 3 1 2
2 4 1 3
2 1 2 1
2 1

EMPNO NAME CL PL
1 ravikumar 4 2
2 3
3

2 ravindra 1 4
1
1

I don't understand your requirements. Why does data from the CL table appear
in both the CL and PL columns? What determines this output?

Please post DDL and post sample data as INSERT statements rather than
sketches of tables.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--


.



Relevant Pages

  • Re: Query for search engine
    ... > relational database and is not restricted to SQL server. ... > our internet site and SQL for our intranet sites. ... >> Could you please post some DDL, sample data and expected result? ...
    (microsoft.public.sqlserver.programming)
  • Access SUMs Full Column When Using Subquery
    ... I jumped over to SQL Server, and it gave me the results I wanted, so ... Sample Data: Students_02272005_1 ... SELECT clause due to conditions specified on the subquery's WHERE ... Stud_ID Lesson PercentAbove5 ...
    (microsoft.public.access.queries)
  • Re: join on 3 tables for asp output
    ... The table structure and sample data is ... >> Mondays since I am scheduling instruments for a whole week. ... > some outer joins (I'm assuming this is SQL Server, ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: how to conver nvarchar with value like(12.23) to time (12:23)
    ... Can you please give us a script of some sample data to try out? ... Pro SQL Server 2000 Database Design - ... > "Arithmetic overflow error converting expression to data type datetime" ... > INSERT INTO TourItemsTemp (FromTime, ToTime, TimeCodeID, ...
    (microsoft.public.sqlserver.programming)
  • Re: consolidating recordsinto a new table
    ... Compass Technology Management - www.compass.net ... Pro SQL Server 2000 Database Design - ... > HERE IS SOME SAMPLE DATA FROM TABLE B ...
    (microsoft.public.sqlserver.programming)