• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

Check the value of a decimal type column

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
TECH_NET
Asked:
TECH_NET
  • 4
  • 3
1 Solution
 
Chris MangusDatabase AdministratorCommented:
Select X From myTable where IsNumeric(X) = 0

This will catch any non numeric rows.
0
 
TECH_NETAuthor Commented:
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
 
Chris MangusDatabase AdministratorCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Chris MangusDatabase AdministratorCommented:
My code will update all of your Y columns.  Are you wanting to do this on a row-by-row basic?
0
 
TECH_NETAuthor Commented:
yes, i want to update only rows where the column of price is not numeric,
0
 
Chris MangusDatabase AdministratorCommented:
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
 
TECH_NETAuthor Commented:
Thank you for your quick responses.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now