Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to combine 2 records in 1 line?

Author  Topic 

elbimbo29
Starting Member

1 Post

Posted - 2009-10-08 : 10:23:20
Hi, I am new to SQL and I have a problem. Please help

I have 2 record with identical IdNo

IdNo amount1 amount2 status1 status2
1 100 null cover null
1 null 200 null note

Since they have the same IdNo I like this to look like

IdNo amount1 amount2 status1 status2
1 100 200 cover note


how can I do this.

Thanks a lot.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-08 : 10:33:35
Start with

select idno,max(amount1), max(amount2),max(status1),max(status2) from your_table


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -