On 5/8/2012 9:58 PM, Shorty wrote:
I've got a database that users can request to join the mailing list.
After they add their name and email address, I'll assign them a userID
number.
The database looks like this:
recordID userID name email
1 1 John [email protected]
2 2 Mike [email protected]
3 3 Bill [email protected]
4 null Steve [email protected]
this works:
SELECT max(userID) AS 'highest_userID' FROM maillist WHERE userID <> ''
then highest_userID is returned with a value of 3
Your database doesn't contain the data you think it does. Unassigned
userId values are not NULL, but empty strings. By SQLite rules, any
string is compared greater than any number.
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users