Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 2nd, 2005, 11:01 AM   #1
rag05
Newbie
 
rag05's Avatar
 
Join Date: Oct 2005
Location: Texas
Posts: 11
Rep Power: 0 rag05 is on a distinguished road
Question about the SUM function in SQL

Hello,

If we have the following query (in ASP):


rs.Open "SELECT SUM(salary) FROM employees WHERE salary > 55000",db1
What is returned in case there are NO salaries > 55000?

Thanx for your help.
__________________
There are only two kinds of programming languages:
those people always bitch about and those nobody uses.

-- Bjarne Stroustrup
rag05 is offline   Reply With Quote
Old Nov 2nd, 2005, 11:20 AM   #2
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
I think it'll return NULL. Also use 'as' in your query like
rs.Open "SELECT SUM(salary) as total FROM employees WHERE salary > 55000",db1

then you can use it in further expressions.

Also, Animated avatars are not allowed on this forum. So change your avatar.

Edit: MyPosts%100==0!
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old Nov 2nd, 2005, 11:31 AM   #3
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
Anyways, Welcome to the forums.
One good thing to do after you join a forum is read the Forum Rules.
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old Nov 2nd, 2005, 2:06 PM   #4
rag05
Newbie
 
rag05's Avatar
 
Join Date: Oct 2005
Location: Texas
Posts: 11
Rep Power: 0 rag05 is on a distinguished road
Thanx

Thanx for your help and thanx for the info...

I already changed the avatar...

__________________
There are only two kinds of programming languages:
those people always bitch about and those nobody uses.

-- Bjarne Stroustrup
rag05 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC