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
 using MAX before a statement

Author  Topic 

kali1979
Starting Member

1 Post

Posted - 2014-05-14 : 04:32:16
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)

17689 Posts

Posted - 2014-05-14 : 04:58:47
not really sure what you are after, but perhaps you can use IF statement

IF ( some condition )
SELECT statment1
ELSE
SELECT statment2



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -