- Oct 10, 1999
- 9,286
- 15
- 81
I am trying to take this SQL:
and then group the records by 'regional_manager'. I am wondering if its a DO..WHILE, WHILE, FOREACH or FOR.
The data should go something like this
Any suggestions?
SHUX
SELECT transaction_id, username, service_area, ws_device_time, time_in_store, end_date, comments, excusable, regional_manager, rm_comments
FROM S3J_DA
WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= end_date AND excusable='N'
GROUP BY regional_manager, username
ORDER BY regional_manager, end_date
and then group the records by 'regional_manager'. I am wondering if its a DO..WHILE, WHILE, FOREACH or FOR.
The data should go something like this
regional_manager
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
regional_manager
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
regional_manager
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
regional_manager
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
transaction_id | username | service_area | ws_device_time | time_in_store | end_date | comments | excusable | rm_comments
Any suggestions?
SHUX