I am trying to do comparison operators on my postgresql data.
I have a range of data like this
MockTable
ID | IDName | Hours | Minutes |
43 John 30 100
37 Jane 20 92
1 Don 100 22
Each of the fields on the top are labeled in the SQL server as text. I am trying to pull information like this.
Select *
From "MockTable"
WHERE "HOURS">'25';
Thus recieving the 1st and 3rd column back. However I am not getting this results. Input?
'2'in'25'is greater than'1'in'100'. Hence'25' > '100'ALTER TABLE "MockTable" ALTER COLUMN "HOURS" TYPE integer USING (trim("HOURS")::integer);(this will convert your text datatype HOURS column to INTEGER ) this will be useful for you