Re: How do I extract ONE particular field, when multiple table contain the same field name?

Поиск
Список
Период
Сортировка
От Christof Glaser
Тема Re: How do I extract ONE particular field, when multiple table contain the same field name?
Дата
Msg-id 20010914211433.26D8112BF8@pinguin.gl.aser.de
обсуждение исходный текст
Ответ на How do I extract ONE particular field, when multiple table contain the same field name?  (olle.wijk@systecon.se (Olle Wijk))
Список pgsql-sql
On Wednesday, 12. September 2001 11:06, Olle Wijk wrote:
> Hi,
>
> I am pretty new att using SQL-quires, could anyone help me with this
> one:
>
> I want to do the following SQL-query:
>
> Select XID, DENOM, PRICE, FRT, CTID From XItem xi, Category c Where
> xi.System=1 and xi.Category=c.Index
>
> the problem is that the field 'DENOM' is present in both table 'XItem'
> and 'Category' 

Just write: table.field or table-alias.field instead of just 'field' 
(like you did already in the WHERE clause):

Select XID, xi.DENOM, PRICE, FRT, CTID 
From XItem xi, Category c 
Where xi.System=1 and xi.Category=c.Index

Christof
--   gl.aser . software engineering . internet service      http://gl.aser.de/ . Planckstraße 7 . D-39104 Magdeburg


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

Предыдущее
От: Patrik Kudo
Дата:
Сообщение: Re: Which SQL query makes it possible to optain the 3 greatest
Следующее
От: "Wei Weng"
Дата:
Сообщение: Re: Which SQL query makes it possible to optain the 3 greatest values of an interger list ?