Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL
COMPOUND_NAME   500      300        100        30         10       0.1       0.3     
  7977797      73.15965   NULL     43.27641    61.80586    NULL    47.49404    NULL    
7977797      84.85707    NULL      40.38514    34.39364    NULL    12.47919    NULL    
7977797      NULL        NULL      NULL        NULL       NULL     NULL       NULL       
7977797      NULL        NULL      NULL        NULL       20.08656   NULL    -66.87882    
7977797      NULL        53.25329    NULL      NULL       NULL       NULL    NULL    
7977797      NULL       48.55260     NULL      NULL       18.91425    NULL    48.55655    NULL    



here first column is the column header ----->
i want to remove null values and fill beneath values of the null values in first two columns....
Posted
Updated 28-Sep-15 2:29am
v2
Comments
Leo Chapiro 28-Sep-15 8:25am    
Marked as "Unclear"
deepankarbhatnagar 28-Sep-15 8:34am    
Hi, please elaborate your query..
Member 11819086 28-Sep-15 8:36am    
i have taken it from view


/****** Script for SelectTopNRows command from SSMS ******/
SELECT [COMPOUND_NAME]
,[500]
,[300]
,[100]
,[30]
,[10]
,[0.1]
,[0.3]
,[0.01]
,[0.03]
FROM [AFileStorageDB].[dbo].[COMP_CONVALUE]

You have already posted this question - How Do I Make It In The Same Row I,E I Want To Remove Null Values How Do I Do That?[^]. Please do not repost.

I have already shown you how to get rid of the NULL values in this query in my response to your question please correct the querry[^]

To be clear - you need to use ISNULL i.e.
VB
SELECT COMPOUND_NAME, [DATA_TYPE], [PLATE_ID],
        ISNULL([500],0),ISNULL([300],0),ISNULL([100],0),ISNULL([30],0),
        ISNULL([10],0),ISNULL([3],0),ISNULL([1],0),ISNULL([0.3],0),
        ISNULL([0.1],0),ISNULL([0.03],0),ISNULL([0.01],0)
FROM [AFileStorageDB].[dbo].[COMP_CONVALUE]

This will replace the null values with zeroes.

I also showed you what was wrong with your query on the same solution
Quote:
The reason you are getting multiple lines of COMPOUND_NAME 7977797 (for example) is because you have included [WELLPOSITION](for whatever reason you did not show that column in your actual results).
 
Share this answer
 
write not null with attributes then you can able to insert the values easily.......
 
Share this answer
 
Comments
CHill60 28-Sep-15 16:46pm    
Not clear

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