G
Guest
Hi,
I have two tables.
table1
--------
spindex(autonumber PK) job_code layno yd wd
table2
--------
subindex(autonumber pk) spindex(fk) rollno batchno color_code
I want a query to retrieve layno and norecords related to that layno in
second table.
I input job_code.
Means, table1 may contain
spindex job layno yd wd
1 04A001 1 20 30
2 04A001 2 19 28
3 04A001 3 25 32
4 04B001 1 10 20
5 04B001 2 15 25
table2 may contain
subindex spindex rollno batchno colorcode
1 1 560 ABCD 10
2 1 230 JHH 11
3 1 234 KJHK 10
4 1 2354 JHG 12
5 2 654 ETLK 10
6 2 987 DKI 13
7 3 34 LKJ 10
The output could be...(input job_code)
layno totrec
--------------
1 4
2 3
Can you give me the query?
I have two tables.
table1
--------
spindex(autonumber PK) job_code layno yd wd
table2
--------
subindex(autonumber pk) spindex(fk) rollno batchno color_code
I want a query to retrieve layno and norecords related to that layno in
second table.
I input job_code.
Means, table1 may contain
spindex job layno yd wd
1 04A001 1 20 30
2 04A001 2 19 28
3 04A001 3 25 32
4 04B001 1 10 20
5 04B001 2 15 25
table2 may contain
subindex spindex rollno batchno colorcode
1 1 560 ABCD 10
2 1 230 JHH 11
3 1 234 KJHK 10
4 1 2354 JHG 12
5 2 654 ETLK 10
6 2 987 DKI 13
7 3 34 LKJ 10
The output could be...(input job_code)
layno totrec
--------------
1 4
2 3
Can you give me the query?