Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selection with nulls

Author  Topic 

annamaria
Starting Member

30 Posts

Posted - 2007-06-10 : 07:22:51
review

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-10 : 16:04:10
There are max and isnull function, check books online to see if useful.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-11 : 08:29:56
<<
Is there a command called 'MAX' or something like that?
>>

Read about it in sql server help file
Also Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-27 : 12:00:41
quote:
Originally posted by annamaria

review


why are you removing original questions. please refrain from doing that
Go to Top of Page

rjackman1959
Yak Posting Veteran

60 Posts

Posted - 2008-12-27 : 18:06:26
Not sure if this is what your looking for, but here is an example. I'm pretty new to SQL, so I'm sure there is a better way.

select o_cust as 'Customer',
COUNT(o.ord_number) as 'Number Of Orders',
MAX(o.t_miles) as 'Total Miles'
from order as o
where o.printed is NULL
group by o.cust
order by o.cust
Go to Top of Page
   

- Advertisement -