Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Result right now i am Getting is:

EmployeeNo Column1 Column2

1 | NULL | Column2

1 | Column1 | NULL

I want like

EmployeeNo Column1 Column2

1 | Column1 | Column2

Kindly provide any help or way to do this

Thanks in advance
Posted

You can combine the two results of your queries with JOIN. Probably in your case you can use INNER JOIN with EmployeeNumber column.

You can read more about JOINs from here:
SQL JOIN w3schools[^]
 
Share this answer
 
Comments
[no name] 8-Jun-14 16:58pm    
5
Mitesh Gadhiya 8-Jun-14 16:58pm    
Here i am not using two different table...so it is not possible with Join...
norbitrial 9-Jun-14 1:12am    
If you could provide the SQL query I would take a look at it.
check this sql fiddle[^]
read about self joins
http://technet.microsoft.com/en-us/library/ms177490(v=sql.105).aspx[^]
SQL Joins[^]
hope this helps you
 
Share this answer
 
SQL
select distinct EmployeeNo
        ,max(Column1) as Column1
        ,max(Column2) as Column2
from yourtable
group by EmployeeNo
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900