<t>You'll need to make a User-Defined Function if you want to have syntax similar to your example. You could do what you want to do, inline, fairly easily with a CASE expression, as others have said.<br/>
<br/>
The UDF could be something like this:<br/>
<br/>
create function dbo.InlineMax(@val1 int, @val2 int)<br/>
returns int<br/>
as<br/>
begin<br/>
if @val1 > @val2<br/>
return @val1<br/>
return isnull(@val2,@val1)<br/>
end<br/>
<br/>
```<br/>
<br/>
... and you would call it like so ...<br/>
<br/>
```<br/>
SELECT o.OrderId, dbo.InlineMax(o.NegotiatedPrice, o.SuggestedPrice) <br/>
FROM Order o<br/>
<br/>
```</t>