Need to write a script...

Hello all,

I am new to shell scripting. I want to write a shell script which will give me the output of the following query as an attachment in a mail

SELECT /*+ parallel(a,4)*/ban, subscriber_no, business_id, price_plan_code, call_action_code, special_seq_no, toll_soc, toll_feature_code, toll_free_code,toll_num_mins_to_rate,toll_charge_amt, toll_type,toll_class,toll_dur_round_min,
channel_seizure_dt,sys_update_date,CALL_TO_CITY_DESC,at_call_start_period,at_call_end_period
FROM us1412 a WHERE TOLL_NUM_MINS_TO_RATE IS NOT NULL and toll_soc is not null
AND toll_type NOT IN (1,5,4) AND toll_class NOT IN ( 00,01,15 ) and INCOL_TOLL_RERATE_IND'R'
AND toll_type 2 and toll_free_code in (0,4) and rownum<51

Plz Help

Thanks in advance

Pipe the query output to a file, f.ex. call query.log

Then:

echo | mutt -a query.log email@somewhere.com