If my column has record like this:
"0,11.2,2,5,1-2,1,SAMPLE CLOT,',11.2 g/dl,14300,145,negative"
and column data type is text.
How can I find a record <7 (less than seven) from that column.
If i use
cast(substring(p.result,1,2) as float) <7 then this error is occurred:
invalid input syntax for type double precision: " "
and for int this ERROR:
invalid input syntax for integer: "9."
So, I am stuck in there, how to do it.
select * from dg_result_entry_header h inner join dg_result_entry_detail p on h.result_entry_id = p.result_entry_id where p.sub_investigation_id = 243 and h.result_date between '2018-04-01' and '2018-04-30' and cast(substring(p.result,1,2) as int) <7 and p.result is not null
current table structure
i want only <7 count from result column and output like this