Python Forum
Take the biggest value from array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Take the biggest value from array
#9
(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.
Reply


Messages In This Thread
Take the biggest value from array - by dwiga - Jul-14-2017, 02:30 AM
RE: Take the biggest value from array - by dwiga - Jul-14-2017, 02:51 AM
RE: Take the biggest value from array - by dwiga - Jul-14-2017, 06:24 AM
RE: Take the biggest value from array - by dwiga - Jul-19-2017, 04:20 AM
RE: Take the biggest value from array - by DeaD_EyE - Jul-19-2017, 01:51 PM
RE: Take the biggest value from array - by dwiga - Jul-20-2017, 01:28 AM
RE: Take the biggest value from array - by nilamo - Jul-19-2017, 04:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Get the biggest number from a two dimensional list rs74 13 4,153 Aug-09-2020, 04:02 PM
Last Post: deanhystad
  Help with array smallest biggest number thanikos 4 3,406 Nov-30-2017, 01:06 PM
Last Post: thanikos

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020