SQL Help.. :)
Hey Guys.. I have a sql problem I was hoping you could help me with. I have two tables that have dates in them,
CREATE TABLE LABOR_RATE
(
Effective_Date DATE PRIMARY KEY ,
Labor_Rate NUMBER(5,2) NOT NULL
);
CREATE TABLE WORK_ORDER
(
WO# NUMBER ( 3) PRIMARY KEY ,
WO_Date DATE NOT NULL ,
VIN CHAR ( 4) NOT NULL ,
Mileage NUMBER ( 7) NOT NULL
);
I need to join these two tables together so I can view a work order and date with the effective labor rate and date for that work order. The results would look like:
WO# WO_DATE EFF_DATE LAB_RATE
---- --------- --------- --------
101 04-JUL-00 27-DEC-99 $50.00
102 04-JUL-01 27-DEC-99 $50.00
103 04-JUL-02 11-SEP-01 $52.50
104 04-JUL-03 26-OCT-02 $55.00
105 04-JUL-04 26-OCT-02 $55.00
106 01-JAN-05 26-OCT-02 $55.00
107 05-MAY-05 05-MAY-05 $57.50
108 04-JUL-05 22-JUN-05 $58.75
109 11-SEP-05 29-JUL-05 $60.00
Does anyone know of the SQL command I would use?
|