Please, help me or I will smash my computer!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
scepanmali
Forum Newbie
Posts: 2
Joined: Sun Nov 04, 2007 7:11 am

Please, help me or I will smash my computer!

Post by scepanmali »

OK, here is the problem:
I use Mysql and I have 5 tables in database. How to sum rows in all of them to get
total number of rows! Example: In one of them I have 20 rows. In the second one I have
10 and so on. I want to produce one number of 30! It's not problem to count rows
in one table, but in all 5 of them...
PLEASE, IF SOMEONE KNOWS HOW TO DO THAT, I will be very thankful!
Thank You in advance :madblow:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Descriptive Subjects

Post by feyd »

If this is throwing you into a fit, I'd stop now.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
scepanmali
Forum Newbie
Posts: 2
Joined: Sun Nov 04, 2007 7:11 am

Re: Descriptive Subjects

Post by scepanmali »

feyd wrote:If this is throwing you into a fit, I'd stop now.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
OK, if you don't want to help me, don't talk with me and go to another place!
Stay out of my thread! I am a beginner, so if you have problem with that, almighty YOU, go away and let other GOOD people to help! Good bye!
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

where's the smashed computer?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

LOL

Code: Select all

select (select count(*) from table_one) + (select count(*) from table_two) + (select count(*) from table_three)  + (select count(*) from table_four) + (select count(*) from table_five) as total_rows from table_one limit 1
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Re: Descriptive Subjects

Post by aaronhall »

scepanmali wrote:
feyd wrote:If this is throwing you into a fit, I'd stop now.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
OK, if you don't want to help me, don't talk with me and go to another place!
Stay out of my thread! I am a beginner, so if you have problem with that, almighty YOU, go away and let other GOOD people to help! Good bye!
Rule #1 of the internet: never pick fights with forum moderators
Rule #2 of the internet: never break forum rules and get offended when someone points the offense out, lest you make a complete jackass of yourself
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Descriptive Subjects

Post by Kieran Huggins »

aaronhall wrote:I love lamp (but I have something going on with Python on the side).
:rofl:

That HUSSY!
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

:lol: she's been around
Post Reply