Sql statement
-
Hello, I have three tables: Personnel, Course, Education. with persid the primary key of the personnel table and foreign key in the other two tables. My problem is: Show personnel details that are either following a course or an education. Can some one please help? thanks alot, Commickey
-
Hello, I have three tables: Personnel, Course, Education. with persid the primary key of the personnel table and foreign key in the other two tables. My problem is: Show personnel details that are either following a course or an education. Can some one please help? thanks alot, Commickey
I'm assuming from your title that you want help with the SQL statement
SELECT *
FROM Personnel AS p
INNER JOIN Course AS c ON c.persid = p.persid
WHERE ...or
SELECT *
FROM Personnel AS p
INNER JOIN Education AS e ON e.persid = p.persid
WHERE ...Without more information that is as much as I can help you with
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
I'm assuming from your title that you want help with the SQL statement
SELECT *
FROM Personnel AS p
INNER JOIN Course AS c ON c.persid = p.persid
WHERE ...or
SELECT *
FROM Personnel AS p
INNER JOIN Education AS e ON e.persid = p.persid
WHERE ...Without more information that is as much as I can help you with
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
I want to select information of personel in schools and personeels in curses and display at once... so my querry should contain three of the tables at once... any help?
SELECT *
FROM Personnel AS p
INNER JOIN Education AS e ON e.persid = p.persid
INNER JOIN Course AS c on c.persid = p.persid
WHERE ...
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
SELECT *
FROM Personnel AS p
INNER JOIN Education AS e ON e.persid = p.persid
INNER JOIN Course AS c on c.persid = p.persid
WHERE ...
Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
some personeel have education history others have short course history I have 3 tables: Personeel, Courses and Education. Personeel table have primary key persId which is foreign in the other 2. My question: How do I get the personel details of: those havin education history those having course history Combine the above two in one list and display as just a single list in a datagrid? This will become the list of active employees. How will the querry look like and what other things do I need to do... I have tried several things out but I am really stuck. Thanks alot, Commickey
-
some personeel have education history others have short course history I have 3 tables: Personeel, Courses and Education. Personeel table have primary key persId which is foreign in the other 2. My question: How do I get the personel details of: those havin education history those having course history Combine the above two in one list and display as just a single list in a datagrid? This will become the list of active employees. How will the querry look like and what other things do I need to do... I have tried several things out but I am really stuck. Thanks alot, Commickey
One option: Select t1.persId, t2.courseDate, t2.courseName, t3.educationDate, t3.educationName from (Personal t1 full outer join Course on t1.persId = t2.persId) full outer join Education t3 on t1.persId = t3.persId where ...... ..... Second option Select t1.persId, t2.courseDate, t2.courseName from Personal t1 full outer join Course on t1.persId = t2.persId where ... ... union all Select t1.persId, t2.educationDate, t2.educationName from Personal t1 full outer join Education on t1.persId = t2.persId where ... ... Both query will give you the result. The first query works in Oracle - If you need SQL server I will help you - Actually I tested it and it works fine on sqlserver or any other ANSI RDBMS. Yossi Kahlon -- modified at 10:55 Wednesday 21st June, 2006