Re: [GENERAL] SELECT statement with sub-queries
От | Michelle Konzack |
---|---|
Тема | Re: [GENERAL] SELECT statement with sub-queries |
Дата | |
Msg-id | 20170528185403.GJ3646@cq58.hosts.tdnet.eu обсуждение исходный текст |
Ответ на | Re: [GENERAL] SELECT statement with sub-queries (Adrian Klaver <adrian.klaver@aklaver.com>) |
Ответы |
Re: [GENERAL] SELECT statement with sub-queries
Re: [GENERAL] SELECT statement with sub-queries |
Список | pgsql-general |
On 2017-05-28 11:23:47 Adrian Klaver hacked into the keyboard: > On 05/28/2017 10:53 AM, Michelle Konzack wrote: > >> > >>SELECT * FROM products WHERE category IN > >> (SELECT categories.cat FROM categories WHERE > >> categories.serial = products.category); > Because you are comparing categories.cat ehm no I want to replace in the output the numerical ID from "products.category" with the value of "categories.cat", where the "products.category" match the "categories.serial" > which is a varchar to > products.category which is an integer. The above is crying out for > FOREIGN KEYS. For the time being I going to assume products.category > is a faux FK to categories.serial so; > > SELECT * FROM products WHERE products.category = categories.serial; This is not working -- Michelle Konzack Miila ITSystems @ TDnet GNU/Linux Developer 00372-54541400
Вложения
В списке pgsql-general по дате отправления: