Hi
I have data like below
Code Emp1 Emp2 Emp3
1677 S-EMPL-0021
1494 S-EMPL-0218 S-EMPL-0218
I want to displat data of Code field from 1 table say master
Emp1,Emp2,Emp3 data from another table say Trans
Thanks
Hi
I have data like below
Code Emp1 Emp2 Emp3
1677 S-EMPL-0021
1494 S-EMPL-0218 S-EMPL-0218
I want to displat data of Code field from 1 table say master
Emp1,Emp2,Emp3 data from another table say Trans
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rikam PalkarPosted Apr 5, 2025, 6:13 PM
you'll need to join the two tables using a common field
Code.try this:
Eliana BlakePosted Apr 5, 2025, 5:24 AM
Hi there! To display the data as described using SQL queries, you can achieve this by performing a JOIN between the "master" and "Trans" tables based on the Code field. Here's an example SQL query for your scenario:
In this query:
- We are selecting the Code field from the "master" table and the Emp1, Emp2, and Emp3 fields from the "Trans" table.
- By using JOIN and specifying the condition `master.Code = Trans.Code`, we are linking the two tables based on the common field "Code".
When you execute this query, it will fetch data from the specified fields in both tables where the Code values match.
If you have actual table names and column names, make sure to replace "master" and "Trans" with your actual table names and adjust the column names accordingly.
I hope this helps! If you have any more questions or need further clarification, feel free to ask.