Date: 11/25/00
- Next message: Holger Blasum: "Re: [phplib] error with $sess->delete()"
- Previous message: rquinn <email protected>: "[phplib] Digital unterschriebene E-Mail von FreeMail / Digitally signed email from FreeMail"
- Maybe in reply to: Jesse Swensen: "Re: AW: [phplib] the "Group by" Function Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
this sounds fine, but it is IMHO better to use an alias, if i want to MAX or COUNT on several fields: "select MAX(age) as MAXAGE, MAX(income) AS MAXINCOME from tblusers" then I can rename the resultset attributes the way I want them - it also provides for better SQL Vendor independence.
Usually, the MAX(on the auto_increment field) function is only used by people who don't know how to get get the last_insert_id, it is a *very* dirty way of getting the ID of the record you just inserted. The problems are, of course, that there may have been further inserts in the meantime, especially problematic if inserts have been given priority over selects in the MYSQL configuration.
On Friday I posted some code, showing how I modified the db_mysql DB_Sql class to add mysql Last Insert ID support, but no one seems to have an opinion on this (hmmm).
Cheers,
- Rich
"Arno A. Karner" <karner <email protected>> schrieb am 25.11.00:
> sql function return one row with the field name is the function name
> ex select max(amount), avg(amount), min(amount) from data;
> would return one row
> max,avg,min
> uncless you alais the selected field/function
>
> My opinions are my own and not that of my employer even if I am self
> employed
> Tech Net, Inc. --FREE THE MACHINES--
> 651.224.2223
> 627 Palace Ave. #2 karner <email protected>
> karner <email protected>
> St. Paul, MN 55102-3517 www.tnss.com
> wanted : adsl/cable modem with static ip at reasonable price
> accept-txt: us-ascii,html,pdf
> accept-dat: ascii-delimited,sql insert statments
-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Richard Quinn Internet Entwicklung
rquinn <email protected> 0721 850 0637 (Mobil 0173 664 1468)
Faxe und VoiceMail an: 0180 / 50 52 54 64 77 74
_______________________________________________________________________________
Alles unter einem Dach: Informationen, Fun, E-Mails. Bei WEB.DE: http://web.de
Sicher kommunizieren: E-Mail Verschlüsselung, Spamfilter http://freemail.web.de
- application/x-pkcs7-signature attachment: S/MIME Cryptographic Signature
- Next message: Holger Blasum: "Re: [phplib] error with $sess->delete()"
- Previous message: rquinn <email protected>: "[phplib] Digital unterschriebene E-Mail von FreeMail / Digitally signed email from FreeMail"
- Maybe in reply to: Jesse Swensen: "Re: AW: [phplib] the "Group by" Function Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

