You are here: Re: Mix two tables in a single SELECT statement - not a join « PHP Programming Language « IT news, forums, messages
Re: Mix two tables in a single SELECT statement - not a join

Posted by bizt on 11/10/05 12:40

Ok, tried a simple example:

$select = "SELECT title, desctext FROM commnews UNION SELECT title,
article AS desctext FROM pressnews ORDER BY createdon";

$result = pg_exec ($db, $select);


But giving me the following error:


Warning: pg_exec(): Query failed: ERROR: column "createdon" does not
exist in /data/httpd/VirtualHosts/web-sandbox/htdocs/_testing/union.php
on line 34


The column 'createdon' does exist in both so I can only assume that my
ORDER BY command isnt properly formated. Is this the correct way to
ORDER a UNION SELECT?

Cheers

Burnsy

 

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

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