
            select
                count(MessageRecipient_id) as "InputCount_all",
                (
                    select
                        COUNT(MessageRecipient_id)
                    from
                        msg.v_MessageRecipient

                    where
                        UserRecipient_id = '392490596527' and COALESCE(Message_isRead,0)=0

                ) as "InputCount_new",
                (
                    select
                        COUNT(Message_id)
                    from
                        msg.v_Message

                    where
                        UserSend_ID = '392490596527'
                        and COALESCE(Message_isDelete,0)=0

                        and COALESCE(Message_isSent,0)=1

                ) as "OutputCount",
                (
                    select
                        COUNT(Message_id)
                    from
                        msg.v_Message

                    where
                        UserSend_ID = '392490596527'
                        and COALESCE(Message_isSent,0)=0

                ) as "DraftCount"
            from
                msg.v_MessageRecipient

            where
                UserRecipient_id = '392490596527'
        
