|
Posted by JDS on 11/11/05 19:24
On Thu, 10 Nov 2005 15:43:38 -0800, Dave Smith wrote:
> I am joining three tables all of which contain the same field name.
> example:
> CLNT_STATS_YTD.Vol_Collected
> CLNT_STATS_MTD.Vol_Collected
> CLNT_STATS_TD.Vol_Collected
>
> If I try to reference them using those names I get no data. If I use the
> last half "Vol_Collected" I get the last value of the three. I'm not
> sure how to reference them seperately in php. Thank you for any help.
>
> Dave
I'm sure somebody already answered this, but here goes...
You have to use column "aliases" in the SQL statment:
SELECT CLNT_STATS_YTD.Vol_Collected as "ytd_collected"
, CLNT_STATS_MTD.Vol_Collected as "mtd_collected"
, CLNT_STATS_TD.Vol_Collected as "td_collected"
FROM whatever;
--
JDS | jeffrey@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
Navigation:
[Reply to this message]
|