You are here: Re: MySQL is making me nuts! « PHP Programming Language « IT news, forums, messages
Re: MySQL is making me nuts!

Posted by Justin Koivisto on 10/26/05 20:27

smorrey@gmail.com wrote:
> Just a note I'ld thought I'ld mention.
> The other logical solution is this.
>
> SELECT deposits - withdrawls as balance FROM(
> (SELECT sum(from_amount ) as withdrawls FROM transactions WHERE
> from_user = '1' UNION
> SELECT sum(to_amount) as deposits FROM transactions WHERE to_user =
> '1' )
>
> Which produces the following error
>
> #1248 - Every derived table must have its own alias
>
> I'm going into a corner to cry now.

at the very end of that statement, simply add " as table1" and you
should be good.

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация