Hi Jason!
Give this a try for the required table you want to produce below...
SELECT Name, Income, Out, (Income - Out) AS Balance
FROM <tablename>;
Sam.
----
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 1:45 PM
Subject: MySQL question to ask
Dear all,
Sorry to ask question again, or maybe i am just a beginner.
I wanna ask:
If there are 2 records
Name Income Out
Data1 1000 700
Data2 970 500
If i want to have the output:
Name Income Out Balance
Data1 1000 700 300
Data2 970 500 770
How to do that?
Thx!!!!!!!!
Yours sincerely,
Jason Chan
=================
This message has been virus scanned by Messagelabs.
=================
==============================================================================
This message has been checked for all known viruses by MessageLabs.
This message is intended for the stated recipients only and may be confidential.
Opinions expressed in this email do not necessarily reflect the opinions of GlobePost
Travel or Travelselect.com. If you are not the intended recipient of this message,
please notify the sender immediately.
==============================================================================
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php