sql simple problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • questionit
    Contributor
    • Feb 2007
    • 553

    #1

    sql simple problem

    Hi

    if i have these fields :

    name
    paid in
    paid out

    i want to see 'paid in' count for each client & show in ascending order - how would i write sql for doing this?

    Thanks
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Try this query
    [CODE=mysql]SELECT name, SUM(paid_in) AS paid FROM table_name
    GROUP BY name
    ORDER BY paid ASC[/CODE]

    Comment

    Working...