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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using MAX before a statement
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 05/14/2014 :  04:32:16  Show Profile  Reply with Quote
Hi I am trying to get the max value from a column at the begining of the statement before resuming with the statement.

If the max value is 10 then use the value in the statement

for example
select max(colum1
SELECT a.coloumn1, b.column2,
FROM table1 a
LEFT JOIN table2 b
ON a.column1=b.column2

In (Som, Ni, Yak)

17689 Posts

Posted - 05/14/2014 :  04:58:47  Show Profile  Reply with Quote
not really sure what you are after, but perhaps you can use IF statement

IF ( some condition ) 
    SELECT statment1
    SELECT statment2

Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000