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.
| Author |
Topic |
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2010-05-06 : 08:03:34
|
| Help on this How to find out the biggest or smallest of two numbers without using logical and Relational Operator ?Thankswood |
|
|
gpl
Posting Yak Master
195 Posts |
Posted - 2010-05-06 : 08:16:03
|
| That pretty much rules out everything!What are you trying to do and why the restriction ? |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-05-06 : 08:33:08
|
| Probably some kind of homework or test or something.- LumbagoIf the facts don't fit the theory, change the facts. Albert Einstein |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-06 : 08:50:28
|
What do you mean?Do you have examples of input/output and what kind of solution you don't want to use? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-05-06 : 09:22:25
|
| Look at the two numbers and then pick the biggest or smallest. CODO ERGO SUM |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
apodemus
Starting Member
30 Posts |
Posted - 2010-05-06 : 10:01:29
|
| I agree MVJ :)apodemus |
 |
|
|
DBA in the making
Aged Yak Warrior
638 Posts |
Posted - 2010-05-06 : 10:22:03
|
quote: Originally posted by WoodHouseHow to find out the biggest or smallest of two numbers without using logical and Relational Operator ?
Even though it sounds like homework...DECLARE @Num1 INT SET @Num1 = 5DECLARE @Num2 INT SET @Num2 = 10DECLARE @tbl TABLE (Num INT)INSERT INTO @tblSELECT @Num1 UNION ALLSELECT @Num2SELECT MIN(Num) AS Smallest, MAX(Num) AS LargestFROM @tmp ------------------------------------------------------------------------------------Any and all code contained within this post comes with a 100% money back guarantee. |
 |
|
|
|
|
|