I've been pulling my hair out to figure this query out.
My output is sorted by LNAME, it also must show all the
8 row numbers from TABLEA even though only 6 rows exist in TABLEB. BTW I'm writing this query for access but it should work in SQL just the same. No stored proc or fancy stuff I need ONE query that would select all the data from both tables. There must be 4 rows total. The expected output in one table as shown below. PLEASE HELP!
Here is the data:
TABLE1
row_a row_b
----- -----
1 5
2 6
3 7
4 8
TABLE2
FNAME LNAME GRADE
----- ----- -----
JOE AMES C
JEFF FRANKSON B
BILL BARTSON A
TIM CARRY A
JOHN DOE B
JANE ZIMMER C
HERE EXPECTED OUTPUT:
ROW_A NAME_A GRADE_A ROW_B NAME_B GRADE_B
----- ------ ----- ------ -------- ------
1 AMES,JOE C 5 FRANKSON,JEFF B
2 BARTSON,BILL A 6 ZIMMER, JANE C
3 CARRY, TIM A 7
4 DOE,JOHN B 8
My output is sorted by LNAME, it also must show all the
8 row numbers from TABLEA even though only 6 rows exist in TABLEB. BTW I'm writing this query for access but it should work in SQL just the same. No stored proc or fancy stuff I need ONE query that would select all the data from both tables. There must be 4 rows total. The expected output in one table as shown below. PLEASE HELP!
Here is the data:
TABLE1
row_a row_b
----- -----
1 5
2 6
3 7
4 8
TABLE2
FNAME LNAME GRADE
----- ----- -----
JOE AMES C
JEFF FRANKSON B
BILL BARTSON A
TIM CARRY A
JOHN DOE B
JANE ZIMMER C
HERE EXPECTED OUTPUT:
ROW_A NAME_A GRADE_A ROW_B NAME_B GRADE_B
----- ------ ----- ------ -------- ------
1 AMES,JOE C 5 FRANKSON,JEFF B
2 BARTSON,BILL A 6 ZIMMER, JANE C
3 CARRY, TIM A 7
4 DOE,JOHN B 8