SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

kali1979
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.

example
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

khtan
In (Som, Ni, Yak)

Singapore
17658 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
ELSE
    SELECT statment2



KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.03 seconds. Powered By: Snitz Forums 2000