add some sql and logic /aak /mrg