Re: stupid SQL question, how reach different rows of two almost same tables

Поиск
Список
Период
Сортировка
От Jaromír Kamler
Тема Re: stupid SQL question, how reach different rows of two almost same tables
Дата
Msg-id 200510061253.25931@centrum.cz
обсуждение исходный текст
Ответ на stupid SQL question, how reach different rows of two almost same tables  (" Jaromír Kamler" <kamler@centrum.cz>)
Ответы Re: stupid SQL question, how reach different rows of two almost same tables  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
Thanks for your reply, I tryed it and modified it for my needs, but this is result:

--error message
SQL error:

ERROR:  subquery in FROM must have an alias
HINT:  For example, FROM (SELECT ...) [AS] foo.

In statement:
create temp table t1 as
select * from (select f_table_name from geometry_columns intersect select jmeno from tables) as tmp_foo;

select * from (select f_table_name from geometry_columns except select jmeno from tables)) as tmp_foo1
union
select * from (select jmeno from tables except select f_table_name from geomety_columns) as tmp_foo2;

I was traying somethin like this, but it looks like wrong way:
SELECT f_table_name FROM geometry_columns WHERE (SELECT jmeno FROM tables) NOT IN (SELECT f_table_name FROM
geometry_columns);


Thank you for your help
Jaromir Kamler
______________________________________________________________
> Od: systemguards@gmail.com
> Komu: kamler@centrum.cz
> CC: pgsql-novice@postgresql.org
> Datum: 04.10.2005 23:51
> Předmět: Re: stupid SQL question, how reach different rows of two almost same tables
>
> On 10/4/05, Jaromír Kamler <kamler @centrum.cz=""> wrote:
> > I am sorry, I know that this is an SQL problem ... . I need reach
> different
> > rows in 2 almost same tables. I need use it in PL/pgSQL. Thanks for your
> > advidce.
> >
> >
>
> this works?...
>
> create temp table t1 as
> select * from (select * from foo1 intersect select * from foo2) as
> tmp_foo;
>
> select * from (select * from foo1 except select * from t1) as tmp_foo1
> union
> select * from (select * from foo2 except select * from t1) as tmp_foo2;
>
>
> --
> regards,
> Jaime Casanova
> (DBA: DataBase Aniquilator ;)
> </kamler>


В списке pgsql-novice по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Schema handling within plpgsql
Следующее
От: Steve Tucknott
Дата:
Сообщение: Tranactions and viewing updated data