Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Query that is not being co-operative...........

Status
Not open for further replies.

gaerb

Programmer
Sep 18, 2002
1
US
I am trying to do something real simple and have been pounding my head against the wall for the last hour trying to figure it out.

I need to return all data in a row that doesnt contain a decimal.

I was trying something like this:

Select Col from Tbl where not exists (
Select Col from Tbl where Col contains ".")

Keeps popping an error.

Note: this needs to run on both MSSQL Server and Oracle 8/9 i
 
"all data in a row that doesnt contain a decimal"

To get "all data in a row"
SELECT * FROM Tbl

"a row that doesnt contain a decimal"
Well I think rows don't contain decimals.
Rows contain columns perhaps.

And columns contain data.

A column may contain various types of data, numbers and characters. Now while it is true that numbers may contain decimal points, it is false that the values in numerical types of columns contain decimal points. It just looks that way sometimes.

One might store numbers as characters in a column.
In that case karluk has the answer, at least for one column named Col, but what of the other columns? And what if gaerb was talking about the name of the column and not the data at all!

I think karluk found the answer in a book though, I doubt that it came from pounding his head against a wall.

Occasionally MS SQL Server and Oracle will pop error messages that are meaningful. What was that message?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top