Topic: Fetching data from a foreign key

Hello Dmitry, Derek, Siibprogsistem and all MVD lovers

I want to pull an information foreign key id_students in table Exeat.

Example
SELECT fullname FROM students WHERE id_students is found in column  id_students in table Exeat

Is this possible?

if not how do I achieve that.

Thanks in advance

Post's attachments

Attachment icon new.JPG 22.28 kb, 223 downloads since 2019-10-14 

2 (edited by sibprogsistem 2019-10-14 08:56:38)

Re: Fetching data from a foreign key

попробуйте так.

SQLExecute('SELECT firstname FROM students LEFT OUTER JOIN Exeat ON students.id=Exeat.id_students  WHERE Exeat.id= ' + Form1.TableGrid1.sqlValue );

Re: Fetching data from a foreign key

sibprogsistem wrote:

попробуйте так.

SQLExecute('SELECT firstname FROM students LEFT OUTER JOIN Exeat ON students.id=Exeat.id_students  WHERE Exeat.id= ' + Form1.TableGrid1.sqlValue );

Большое спасибо, брат. Я дам ему попробовать

Re: Fetching data from a foreign key

sibprogsistem wrote:

попробуйте так.

SQLExecute('SELECT firstname FROM students LEFT OUTER JOIN Exeat ON students.id=Exeat.id_students  WHERE Exeat.id= ' + Form1.TableGrid1.sqlValue );

Wow, it works like magic, i edited some words and it works perfectly. Sibprogsistem, you are a genius.