Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Check the value of a decimal type column

Posted on 2007-11-16
Medium Priority
221 Views
I have a SQL table column X which hold a data type varchar2

I have the table populated with some records.

and the data looks like

21.98
23.87
34.12 OFF
12.23

etc

I want to find the row that does not hold a value price. How can i find it.
I need the row 34.12 OFF to be retrieved for the illustration.
0
Question by:TECH_NET
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 4
• 3

LVL 17

Expert Comment

ID: 20301274
Select X From myTable where IsNumeric(X) = 0

This will catch any non numeric rows.
0

Author Comment

ID: 20301325
It works great. Exactly what i wanted. Now another question.

one of the value of the price column was

Skil 7.2-volt Lithium-Ion Power Wrench -

How can i update the another column Y, with the value of the PRICE, and if the column Y has a value , can i append the value of the PRICE column to value of column Y.

I increased the points to 500
0

LVL 17

Expert Comment

ID: 20301373
Update myTable Set Y = IsNull(Y, '') + IsNull(X, '')
Where IsNumeric(X) = 0

The IsNulls are there to catch any instance where you don't have an existing value in Y or in the event the data in column X is null.
0

LVL 17

Expert Comment

ID: 20301376
My code will update all of your Y columns.  Are you wanting to do this on a row-by-row basic?
0

Author Comment

ID: 20301585
yes, i want to update only rows where the column of price is not numeric,
0

LVL 17

Accepted Solution

Chris Mangus earned 2000 total points
ID: 20301602
Then my code will work as written.  Obviously, if you wanted to do it on specific rows you'd include your PK in the Where clause.
0

Author Closing Comment

ID: 31409641
Thank you for your quick responses.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simpâ€¦
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What â€¦
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increasedâ€¦
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrasâ€¦
###### Suggested Courses
Course of the Month9 days, 9 hours left to enroll