| | |
finding the largest numbers
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 43
Reputation:
Solved Threads: 0
hi all
could any 1 help me out.
im trying to find the biggest id number in a db.
the problem is that the "ID" column is saved as "TEXT"(its important to me).
the language im using is PHP.
10x!
tried to use this but it didnt work
[/code]
could any 1 help me out.
im trying to find the biggest id number in a db.
the problem is that the "ID" column is saved as "TEXT"(its important to me).
the language im using is PHP.
10x!
tried to use this but it didnt work
MySQL Syntax (Toggle Plain Text)
$resultt = mysql_query("SELECT MAX(id) FROM object" , $conn); $row = mysql_fetch_array($resultt); $num=$row[maxnum];
Last edited by severman; Oct 2nd, 2009 at 4:27 pm.
A) Why is your ID field TEXT?
B)
B)
sql Syntax (Toggle Plain Text)
SELECT MAX(CAST(id AS DECIMAL)) as id FROM object
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
![]() |
Similar Threads
- Finding magic numbers (C++)
- find multiple largest numbers (Java)
- How do you find the count of even numbers in a list? (Python)
- Finding the largest four numbers of an input file. (C++)
- Program to find the largest of given numbers without using loop (Java)
- Finding the average of numbers (C++)
Other Threads in the MySQL Forum
- Previous Thread: Mysql query
- Next Thread: Compare and update products pricing columns
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api aws bizspark breathalyzer changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization






