Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Pa help naman po for SQL

uraGON__uraGON__ paralusiMember Posts: 1

Name: REQUEST
NAME DATA TYPE
TASK_ID VARCHAR (6)
CUSTOMER_ID VARCHAR (10)
ACTION_TYPE VARCHAR (10)
CUSTOMER_STATUS VARCHAR (10)
NOTES STRING
CREATED_ON TIMESTAMP(6)
LOGIN VARCHAR (10)
ACTION_DATE TIMESTAMP(6)
LAST_UPDATED_DATE TIMESTAMP(6)

Name: REQUEST_INFO
**NAME **DATA TYPE****
TASK_ID VARCHAR(6)
FIRST NAME VARCHAR(20)
LAST NAME VARCHAR(20)
ADDRESS VARCHAR (256)
MATCH_TYPE STRING
CREATED_ON TIMESTAMP(6)
CREATED_BY VARCHAR(20)
LAST_UPDATED_BY VARCHAR(20)
LAST_UPDATED_DATE VARCHAR(20)

QUESTION:
Write a query to get the below data for the date range between 1-Mar-2015 to 30-Mar-2015 and sorted by CREATED_ON date in the descending order (use tables above).
• TASK_ID
• CUSTOMER_ID
• CUSTOMER_STATUS
• FIRST NAME
• LAST NAME
• ADDRESS
• MATCH_TYPE
• CREATION DATE

Comments

  • B00B00 Member Posts: 115 ✭✭✭

    SELECT r.task_id, r.customer_id, r.customer_status, i.first_name, i.last_name, i.address, i.match_type, r.created_on FROM request AS r, request_info AS i WHERE r.task_id = i.task_id AND r.created_on BETWEEN '2015-03-01' AND '2015-03-31' SORT BY r.created_on DESC;

    Capitalise column/table names if needed.

Sign In or Register to comment.