
Originally Posted by
r937
like everybody else, i have no idea what you're trying to do
however, note that when you do this --
Code:
SELECT COUNT(*) AS number FROM ...
UNION ALL
SELECT COUNT(*) AS number FROM ...
then you will get a result set that looks like this --
and you will have no way to discern which number came from which subquery
Hi r937,Okay let me change my problem.,
Suppose i have this 4 tables.how do i count and group them by empgrp_area where the empNO equals to 00001 ?
Thank you in advance and I am hoping for your positive response.
empheader
Code:
refNo empNO
01 00001
02 00002
03 00001
04 00001
05 00001
06 00003
07 00004
08 00001
empdetail
Code:
refNO empitmcode
01 0000000001
01 0000000002
01 0000000003
02 0000000004
02 0000000004
04 0000000006
05 0000000002
05 0000000002
03 0000000007
03 0000000006
08 0000000001
emptblitm
Code:
empitmcode empdesc empgrp_area
0000000001 puncher 01A
0000000002 pencil 01A
0000000003 paper 02A
0000000004 chair 02A
0000000005 table 02A
0000000006 computer 03A
0000000007 keyboard 03A
empgrp
Code:
empgrp_area grp_desc
01A class1
02A class2
03A class3
04A class4
05A class5
Bookmarks