I want to sort my table but it have NaN value in it,
the problem is in ruby/rails NaN is considered as highest and I want to make it as lowest instead?
I'm thinking about removing the NaN from the list ordering the non NaN list and adding the NaN's after that
anyone have more convenience approach?
my databse is postgresql and the column type is Decimal/BigDecimal and the values is Decimal/BigDecimal
the schema is
create_table "download_speeds", force: :cascade do |t|
t.bigint "location_id", null: false
t.string "operator_name"
t.decimal "avg"
t.decimal "min"
t.decimal "max"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["location_id"], name: "index_download_speeds_on_location_id"
end
and I want to sort/give rank to the downloads_speeds
based on avg
column descendingly
highest avg
is on top (rank 1)