Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Question of the month July 2011 - select 3+-+-+-++4

Jul 13 2011 1:30AM by Madhivanan   

Without running this query, can you guess what would be the answer?

Query

select 3+-+-+-++4

Choose the correct Answer

Answer 1      An error which says incorrect syntax near -
Answer 2      7
Answer 3      -1
Answer 4      None of the above

Tags: t-sql, sql_server, sqlserver, tsql, BRH, #TSQL, #SQLServer, question,


Madhivanan
3 · 39% · 12472
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

9  Comments  

  • I am going with Answer 3. I'm not positive how it works but I know if you do -- it equals +.

    For this one though I would say you are doing this:

    select 3 + -( + -( + (-4))) or adding 3 to a negative results of a negative result of a negative result which results in a negative.

    commented on Jul 14 2011 4:38PM
    sqlsandwiches
    2904 · 0% · 2
  • -1

    Add parenthesis as

    select 3+(-(+(-(+(-(+4))))))
    and remember that every empty argument is 0 by default, so it becomes
    select 3+(0-(0+(0-(0+(0-(0+4)))))) = -1 
    commented on Jul 15 2011 12:39PM
    Szymon Wojcik
    67 · 3% · 839
  • My vote is answer 3: -1

    This is from one of your blog that I read recently.

    commented on Jul 22 2011 7:58AM
    Hardik Doshi
    20 · 9% · 2839
  • It s a real good one. But how is this happening,bcoz consecutive - is giving an error.

    commented on Jul 25 2011 4:31AM
    Senthil
    498 · 0% · 74
  • Ya its taken as comments, for consecutive - .

    commented on Jul 25 2011 4:38AM
    Senthil
    498 · 0% · 74
  • Senthil, in the question there are no consecutive hyphens.

    commented on Jul 25 2011 4:43AM
    Madhivanan
    3 · 39% · 12472
  • Madhivanan,

    Thats correct. I saw one of your other blogs stating consecutive + and - will be made as single. So when I was trying it,Select 3+--4 it was taking data after -- as comments.Got confused at the beginning. Thanks for such interesting ones.

    Regards.

    commented on Jul 26 2011 9:58AM
    Senthil
    498 · 0% · 74
  • Senthil, can you post the link for my other blog post that you were talking about?

    commented on Jul 27 2011 2:27AM
    Madhivanan
    3 · 39% · 12472
  • Select 3+-+-+-++4

    Select 3(+ X -)+-+-++4 = Select 3-+-+-++4

    Select 3(- X +)-+-++4 = Select 3--+-++4

    Select 3(- X -)+-++4 = Select 3++-++4

    Select 3(+ X +)-++4 = Select 3+-++4

    Select 3(+ X -)++4 = Select 3-++4

    Select 3(- X +)+4 = Select 3-+4

    Select 3(- X +)4 = Select 3-4

    Select 3-4 = -1

    commented on Feb 18 2012 4:24AM
    Guru Samy
    9 · 16% · 4992

Your Comment


Sign Up or Login to post a comment.

"Question of the month July 2011 - select 3+-+-+-++4" rated 5 out of 5 by 2 readers
Question of the month July 2011 - select 3+-+-+-++4 , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]