mysql聯表查詢指令碼

來源:互聯網
上載者:User

標籤:mysql聯表查詢指令碼

mysql聯表查詢指令碼:

#!/bin/shkkmailmysqlpass=$(cat /usr/local/kk-mail/config/custom.conf | grep -w "pass" | awk -F" " '{print $NF}')/usr/local/kk-mail/service/mysql/bin/mysql -u kkmail -p$kkmailmysqlpass kkmail -e "select b.realname,a.mailbox,a.quota_mailbox,a.quota_netdisk,a.limit_send,a.limit_recv,c.position,d.title from core_mailbox a,co_user b,co_department_member c,co_department d where a.mailbox_id=b.mailbox_id and a.mailbox_id=c.mailbox_id and c.dept_id=d.id;" >/root/user.txtawk 'BEGIN{OFS="\t"} {if($5==-1){$5="不限制"}if($5==1){$5="禁止"}if($5==2){$5="本域"}if($5==3){$5="指定外域"}if($5==4){$5="本地所有域"}if($6==-1){$6="不限制"}if($6==1){$6="禁止"}if($6==2){$6="本域"}if($6==3){$6="指定外域"}if($6==4){$6="本地所有域"}print}' /root/user.txt >/root/user2.txtcat user2.txt |sed 1d | sed '1i\姓名    郵箱    容量    網盤    發送    接收    職位    部門' >/root/user3.txt


mysql聯表查詢指令碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.