0

I have 2 tables Details,Mstr.
Mstr table contains(PSNO,NAME,DOB,DOJ)=>PSNO- PK
Details(PSNO,NAME,PH,SAL_ACC,ADV,DT_PREP)PSNO-FK
In Grid i need to display
SAL_ACC NAME ADV DT_PREP
12345 abc 150 5/25/2009
12345 abc 300 5/30/2009
12345 abc 200 6/11/2009

how do i do ths,please help

4
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by debasisdas
0

Unless I am misunderstanding you, all of your fields are in the details table, No need for a join.

Good Luck

0

try the following

select b.SAL_ACC ,b.NAME ,b.ADV ,b.DT_PREP from mstr a,detail b where a.psno=b.psno

As vb5prgrmr pointed out, a join is not even necessary because all the data can be obtained from one table.

0

But how can i display d results in the grid,that i dnt knw

0

There can be 15 rows belonging to same person,but with different PREP_DT,i need to show all of then,like i have mentioned earlier,this i dnt know,thats why i made PSNO as foreign key in Details table as a single PSNO vil be having more than 1 records,and i need to display all of them.....

0

As vb5prgrmr pointed out, a join is not even necessary because all the data can be obtained from one table.

what if i want only matching data based on both the tables ?

in that case a join is compulsory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.