Jul-19-2017, 04:50 PM
(Jul-14-2017, 02:30 AM)dwiga Wrote: Hi,
I am new user on python, and I am new user here.
so, can you please help me to fix my python problem...
this table called tbl_a
===================
id | nama | num |
===================
1 | A | 1,2 |
2 | B | 1,3 |
3 | C | 2 |
4 | D | 4,2,1 |
5 | E | 5,3 |
===================
i want to get the biggest value from that table, in that case should be 5 as the biggest value.
I have no idea to write a code.
thanks
Is it too late to redesign the table structure so it isn't so terrible?
num
looks like a varchar, instead of a num like it claims, which is insanity. This wouldn't even need to be a question you'd have to ask if the table was sane, as you could just have the database's index give you the answer lightning-fast: select max(num) from tbl_a where nama=%s
.