Author Topic: MySql Select With Field Operation  (Read 368 times)

0 Members and 1 Guest are viewing this topic.

Offline jfernandesTopic starter

  • Irregular
  • Posts: 2
    • View Profile
MySql Select With Field Operation
« on: February 16, 2010, 08:49:22 AM »
I Need to Create a Select with a Sum and also a result from the sum command

Like this

select sum(Credit) as credit, sum(debit) as Debit, (credit-debit) as balance from statement

don't work

can some please help me

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Mind Boggling!'
  • *
  • Posts: 15,443
  • Gender: Male
    • View Profile
Re: MySql Select With Field Operation
« Reply #1 on: February 16, 2010, 08:50:09 AM »
If you think that's sufficient information, you're mistaken.
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

Offline jfernandesTopic starter

  • Irregular
  • Posts: 2
    • View Profile
Re: MySql Select With Field Operation
« Reply #2 on: February 16, 2010, 08:53:35 AM »
I'm sorry i tod was suffient information.

I need to get a balance from table with credit and debit field.

can you please let me know what else i can provide to you to help me

Thanks

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Mind Boggling!'
  • *
  • Posts: 15,443
  • Gender: Male
    • View Profile
Re: MySql Select With Field Operation
« Reply #3 on: February 23, 2010, 12:47:57 PM »
I don't see what's not working -- see the link in my sig.
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.