This topic is locked

mysql alias

12/31/2008 7:51:09 AM
PHPRunner General questions
C
chorus author

Following question
Before reading : im new to mysql and php <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=10521&image=1&table=forumtopics' class='bbc_emoticon' alt=';)' />
This is my mysql query.

Is there a way to output my alias 'totaal' to the field named totaalbedrag? (because I cannot select a lookup field from an alias in phprunner it seems?)
SELECT

ID,

Naam,

Adres,

Postnummer,

Plaats,

`Email Adres`,

Zaalgebruik,

`Datum zaalgebruik`,

`Aantal Tickets`,

`Bedrag persoon`,

SUM(`Aantal Tickets`*`Bedrag persoon`) AS totaal,

Totaalbedrag

FROM `Ticket Verkoop`

GROUP BY ID, Naam, Adres, Postnummer, Plaats, `Email Adres`, Zaalgebruik, `Datum zaalgebruik`, `Aantal Tickets`, `Bedrag persoon`, `Totaalbedrag`
Regards

J
Jane 1/5/2009

Hi,
I suppose you need to save calculated values in the Totaalbedrag field.

Use Before record added/Before record updated events on the Events tab for this purpose.