select if null fill in row

I have a ms-sql table I need to fill in the column with the repeated column value, for example
Any value thats null I would like it to repeat.


ScreenHunter-01-Sep.-08-10.21.gif
LVL 9
Seven priceFull StackAsked:
Who is Participating?
 
Scott PletcherConnect With a Mentor Senior DBACommented:
>> I am using a order by clause of course <<
>> To produce the right code, the ORDER BY column(s) need to be known. <<
>> >>ORDER BY column(s) need to be known
??<<


What are the names of the ORDER BY column(s)????

There is NO way to write code for this w/o knowing what the ORDER BY columns are!!
0
 
vdr1620Commented:
can you post a sample of your expected output??
0
 
Seven priceFull StackAuthor Commented:
example from the photo is see cComments
if null then printing will fill everything above with the same line.

where dTotal 1023.96 will fill in the null under 50.67 until it reaches anything not null.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Scott PletcherSenior DBACommented:
Do you have an identity column?  Or another sequence key?  The data must be sequenced to do what you are trying to do.
0
 
Seven priceFull StackAuthor Commented:
no but I can use a select count(*)
0
 
Seven priceFull StackAuthor Commented:
WRITE QUERY TO REPEAT VALUE OF PREVIOUS RECORD >>
do you have example?? in a select statement not update
0
 
vdr1620Commented:
are you using any order by clause ...how do you know what your result set will be

4.13  50.67  NULL
NULL NULL  Printing.......

OR

NULL NULL  Printing.......
4.13  50.67  NULL

The Order makes a lot of difference.. Count(*) will not solve the problem..

Also,What would your output be if there are 3 rows like below

1          3      Row1
NULL NULL NULL
2          4        Row3
0
 
Seven priceFull StackAuthor Commented:
I am using a order by clause of course, there will never by 3 null rows, i just need the syntax if you can.

thanks
0
 
Scott PletcherSenior DBACommented:
To produce the right code, the ORDER BY column(s) need to be known.
0
 
Seven priceFull StackAuthor Commented:
>>ORDER BY column(s) need to be known
??
0
 
Seven priceFull StackAuthor Commented:
t
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.