Need help to write query and Help to write SQL (2 threads merged by bb) [message #362317] |
Mon, 01 December 2008 15:00 |
AHBJAG
Messages: 2 Registered: December 2008
|
Junior Member |
|
|
I have following two tables..
TableA
TIMECARD_ID STAFF_ID TIMECARD_PERIOD_ID
17924405 XYZ01 16822218
17926980 XYZ01 16822219
18157933 XYZ01 16822220
18168660 XYZ01 16822221
18394647 XYZ01 16822222
18618683 XYZ01 16822223
18844787 XYZ01 16822224
19072497 XYZ01 16822225
19301059 XYZ01 16822226
19748383 XYZ01 16822227
19973216 XYZ01 16822228
19986552 XYZ01 16822229
20544786 XYZ01 16822230
TableB
STAFF_ID TIMECARD_PERIOD_ID HR_PCT SUPERVISOR_ID BUREAU_ID
XYZ01 16822218 100 SUP01 17922782
XYZ01 16822222 75 SUP01 17922782
XYZ01 16822228 90 SUP02 17922782
I have to display something like this
TIMECARD_ID STAFF_ID TIMECARD_PERIOD_ID SUPERVISOR_ID HR_PCT
17924405 XYZ01 16822218 SUP01 100
17926980 XYZ01 16822219 SUP01 100
18157933 XYZ01 16822220 SUP01 100
18168660 XYZ01 16822221 SUP01 100
18394647 XYZ01 16822222 SUP01 75
18618683 XYZ01 16822223 SUP01 75
18844787 XYZ01 16822224 SUP01 75
19072497 XYZ01 16822225 SUP01 75
19301059 XYZ01 16822226 SUP01 75
19748383 XYZ01 16822227 SUP01 75
19973216 XYZ01 16822228 SUP02 90
19986552 XYZ01 16822229 SUP02 90
20544786 XYZ01 16822230 SUP02 90
Please help me to write this Query.
|
|
|
|
|
|
|