Select statement with except clause

Поиск
Список
Период
Сортировка
От JORGE MALDONADO
Тема Select statement with except clause
Дата
Msg-id CAAY=A79+vsQN3zzPC7CtSoJFPxbp-Kf=yxg-hdCd6AEb3i6P5Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Select statement with except clause  (David Johnston <polobo@yahoo.com>)
Список pgsql-sql
I have one SELECT statement as follows:

SELECT 
lpt_titulo as tmt_titulo, 
tmd_nombre as tmt_nombre, 
tmd_album as tmt_album, 
SUM(lpt_puntos) AS tmt_puntos 
FROM listas_pre_titulos 
INNER JOIN cat_tit_media ON lpt_titulo = tmd_clave "
WHERE condition

The above statement must have an EXCEPT clause which includes another SELECT statement almost identical, the difference is in the WHERE condition and also in one of the fields; "SUM(lpt_puntos) AS tmt_puntos" should be "SUM(lpt_puntos) * -1 AS tmt_puntos". I only need to convert such a field to a negative value.

How does the EXCEPT work? Do fields should be identical?
I need the difference to be on the first 3 fields.

Respectfully,
Jorge Maldonado

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

Предыдущее
От: Ian Lawrence Barwick
Дата:
Сообщение: Re: How to right justify text in psql?
Следующее
От: David Johnston
Дата:
Сообщение: Re: Select statement with except clause