> Pavel Ivanov wrote:
> > It mentions "from" and "column_name" where column name in this
> > particular case is "selected". ;-)
> >
> > @Igor: I thought that sql standard in this case doesn't guarantee
> that
> > outer select will return rows in the same order that were enforced in
> > inner
Pavel Ivanov wrote:
> It mentions "from" and "column_name" where column name in this
> particular case is "selected". ;-)
>
> @Igor: I thought that sql standard in this case doesn't guarantee that
> outer select will return rows in the same order that were enforced in
> inner select by "order by",
Note to self: Do not ask questions before I finish my coffee. ;)
On Wed, Jun 10, 2009 at 11:27 AM, Pavel Ivanov wrote:
> It mentions "from" and "column_name" where column name in this
> particular case is "selected". ;-)
>
> @Igor: I thought that sql standard in this case
It mentions "from" and "column_name" where column name in this
particular case is "selected". ;-)
@Igor: I thought that sql standard in this case doesn't guarantee that
outer select will return rows in the same order that were enforced in
inner select by "order by", does it?
Pavel
On Wed, Jun
Just out of curiosity, where in the syntax documentation does it mention
"selected from"?
On Wed, Jun 10, 2009 at 10:57 AM, Igor Tandetnik wrote:
> Rand Huck wrote:
> > In addition to what was already said, if you absolutely to omit the
> > 'name' from the final result set,
Rand Huck wrote:
> In addition to what was already said, if you absolutely to omit the
> 'name' from the final result set, you should be able to put the
> result of the union in a temporary table.
Or else add an extra layer of indirection:
select id, url, selected from (
SELECT id, url,
In addition to what was already said, if you absolutely to omit the 'name'
from the final result set, you should be able to put the result of the union
in a temporary table.
CREATE TEMPORARY TABLE `tmp` (`id`, `url`, `selected`, `name`);
INSERT INTO `tmp` (
SELECT id, url, selected, name FROM
On Tue, 9 Jun 2009, Simon Slavin wrote:
>> SELECT id, url, selected, name FROM db1.test UNION
>> SELECT id, url, selected, name FROM db2.test
>> ORDER BY name ASC, id DESC LIMIT 100"
>
> I would add to Marin's answer that reading the above, I have no idea
> which database the column 'name'
On 9 Jun 2009, at 11:18am, Martin Engelschalk wrote:
> the column name in the order by - clause "name" has to match one of
> the
> columns of the select statement, because it is a union.
> Your columns are "id", "url" ad "selected", none of which is "name".
>
> Obviously, your table does
Hi,
the column name in the order by - clause "name" has to match one of the
columns of the select statement, because it is a union.
Your columns are "id", "url" ad "selected", none of which is "name".
Obviously, your table does contain a column named "name", but because of
the union this can
Hi,
I get the following error with SQLite 3.6.1
"1st ORDER BY term does not match any column in the result set"
>From the following query
"SELECT id, url, selected, FROM db1.test UNION
SELECT id, url, selected, FROM db2.test
ORDER BY name ASC, id DESC LIMIT 100"
However the equivalent
11 matches
Mail list logo