Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Adrian Klaver
On 05/28/2017 11:54 AM, Michelle Konzack wrote: 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 =

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread David G. Johnston
On Sun, May 28, 2017 at 11:54 AM, Michelle Konzack wrote: > > 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" > ​Then go and read the first

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
On 2017-05-28 20:19:59 m...@ft-c.de hacked into the keyboard: > Hallo, > > SELECT * > FROM products > WHERE exists > (SELECT categories.cat FROM categories WHERE > categories.serial==products.category); This does not give an error but does nothing > or > SELECT * FROM products > WHERE

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
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

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread ml
On 28.05.2017 20:19, m...@ft-c.de wrote: Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); categories.serial = products.category); -- one equal sign or SELECT * FROM products WHERE category IN

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Adrian Klaver
On 05/28/2017 10:53 AM, Michelle Konzack wrote: On 2017-05-29 03:24:54 rob stone hacked into the keyboard: You only need a single equals sign in SQL. SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories WHERE categories.serial = products.category); I have

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread ml
Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); or SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories); On 28.05.2017 19:03, Michelle Konzack wrote: Hello *, I try to

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Michelle Konzack
On 2017-05-29 03:24:54 rob stone hacked into the keyboard: > You only need a single equals sign in SQL. > > SELECT * FROM products WHERE category IN  >     (SELECT categories.cat FROM categories WHERE  >     categories.serial = products.category); I have tried this too, but then I get: ERROR:  

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread rob stone
Hello, On Sun, 2017-05-28 at 20:03 +0300, Michelle Konzack wrote: > Hello *, > > I try to get columns from my database with a singel SELECT, but I > stuck. > > I have 3 tables like: > > > 1)  categories (serial,cat) > > 2)  manufacturers (serial,m_name) > > 3)  products

Re: [GENERAL] SELECT statement with sub-queries

2017-05-28 Thread Amitabh Kant
On Sun, May 28, 2017 at 10:33 PM, Michelle Konzack wrote: > Hello *, > > I try to get columns from my database with a singel SELECT, but I stuck. > > I have 3 tables like: > > > 1) categories (serial,cat) > > 2) manufacturers (serial,m_name) > > 3) products