May be there is a way to do it via sql.
But I am not that much involved to tell how without trying it with real data.
But I am not that much involved to tell how without trying it with real data.