Poppy
Poppy

Reputation: 3092

How to remove commas of integer from MY SQL select query

I am using a mySQL statement that returns me average of values as comma separated integer.

Eg : 2,109. But I want my output to be plain integer like 2109. Please help me on this.

Upvotes: 11

Views: 42874

Answers (1)

miltos
miltos

Reputation: 1019

You can use something like this:

SELECT REPLACE(fieldname, ',', '')
FROM ...

Or if type of fieldname is integer use this query

SELECT REPLACE(CONCAT(fieldname), ',', '')
FROM ...

Upvotes: 16

Related Questions