qry = "SELECT * FROM courses ORDER BY price DESC "
here I have declared price as varchar for logical reasons, so in case of order it gives
output:
{
"id": 5,
"payment_type": "one time",
"price": "1000"
},
{
"id": 11,
"payment_type": "one time", # issue here
"price": "10000"
},
{
"id": 10,
"payment_type": "Lumpsum", # issue here
"price": "12000"
},
{
"id": 2,
"payment_type": "one time",
"price": "3000"
},
{
"id": 13,
"payment_type": "one time",
"price": "3500"
},
{
"id": 12,
"payment_type": "one time",
"price": "4500"
},
.... and so on
Can I ordered this price without changing the datatype of this column?
SET : type of column "varchar" TRYING TO GET : ORDER BY price ASC Or DESC