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

How will you produce zero without using any numbers?

Jun 15 2011 9:25AM by Madhivanan   

Ok. Here is some Fun. This is the script that will produce zero without using any number in the code. Post your code if you find any such method

select 
	$,
	$+,
	$+.,
	-$,
	$*$,
	+$-,
	($),
	$.,
	($.),
	-+$-,
	+-$+.,
	-$+.+$.,
	'$,'-$+,
	'$,.'-$-.	

Run the code and see the output. Each column produces zero as a result.

Tags: t-sql, sql_server, sqlserver, tsql, BRH, SQL Server, #SQLServer, fun, symbol,


Madhivanan
3 · 39% · 12430
2
 
0
Lifesaver
 
0
Refreshed
 
 
0
Incorrect



Submit

23  Comments  

  • WOW! Never knew it!

    commented on Jun 15 2011 10:58AM
    Pinal Dave
    146 · 1% · 326
  • look like, We can use any currency symbol, sql server supports.

    select £ --- Also returns "0"

    My guess is, when it sees any value/expression it tries to identify the datatype. Probably based on currency sumbol, it might identified it as "Money" datatype and showed default value for that...

    commented on Jun 15 2011 11:23PM
    Ramireddy
    2 · 41% · 12972
  • Ramireddy you guess is right

    we can check by following sql

    SELECT cast(sqlvariantproperty($,'BaseType') as varchar(20))

    commented on Jun 16 2011 2:09AM
    priyank
    1720 · 0% · 11
  • Yes....I saw this some time back some one using this..

    But i forgot it.....

    commented on Jun 16 2011 2:17AM
    Ramireddy
    2 · 41% · 12972
  • Waiting for the Rupee symbol to get there :-)

    commented on Jun 16 2011 4:48AM
    Jacob Sebastian
    1 · 100% · 32002
  • Ramireddy, you can use any currency symbol in place of dollor Jacob, we may get Rupee symbol soon

    commented on Jun 16 2011 5:26AM
    Madhivanan
    3 · 39% · 12430
  • I have added some other methods in the code. You all may need to relook it.

    commented on Jun 16 2011 5:31AM
    Madhivanan
    3 · 39% · 12430
  • I think expression $ is always considered as Money Datatype...we can check this also.. select len($)

    commented on Jun 16 2011 9:05AM
    virenraval
    1939 · 0% · 8
  • Huh??!!! I guess SQL Server is more of a magic Pandoras box :) Superb! Thank-you for sharing!

    commented on Jun 16 2011 11:21AM
    Nakul Vachhrajani
    4 · 33% · 10575
  • Cool..never knew about this!

    Could someone give a real-world scenario when/where this could be applied and why?

    TIA

    commented on Jun 16 2011 11:33AM
    Aashish Thakker
    1182 · 0% · 21
  • Excellent trick...!!

    Thanks for sharing..

    commented on Jun 21 2011 2:10AM
    Alpesh Shah
    2893 · 0% · 2
  • Hi Sir I have learn many new thing from this and Pinal Dave's blog. I read here many interesting, I have create and Quiz based on Count (*) and select $ http://current-affairs-quiz-questionsanswers.blogspot.com/2011/06/sql-puzzle-based-on-select-count-t-sql.html

    Once go through it.

    commented on Jun 23 2011 3:43PM
    vikasahlawat22
    2893 · 0% · 2
  • Really great !!! Never knew it. Thanks for sharing.

    commented on Jul 5 2011 3:50AM
    Hardik Doshi
    20 · 9% · 2839
  • Hi Madhi, here is my try...

    SELECT (ASCII('A')-ASCII('A'))+$

    commented on Jul 5 2011 4:28AM
    Karthikeyan
    2893 · 0% · 2
  • select convert(int,'') will produce zero but '' as is (not converted char) is not numeric - and its logic ;)

    commented on Jul 8 2011 3:25AM
    jordanski
    1369 · 0% · 15
  • Yet another way . . .

    declare @zero bit; set @zero = 'false';

    select convert(int, @zero) as zero;

    Still don't know why I'd ever need to do this.

    commented on Jul 8 2011 8:42AM
    Phil Schmidt
    1823 · 0% · 10
  • Select cast('' as int) Select floor(rand()) Select datediff(mi,'','') Select min(number) from master.dbo.spt_values where type='P' Select count() From sys.databases Where 'A'='B' Select count()-count(*) From sys.databases -- could be any table Select min(status) from sys.systypes

    Easy to find a lot of other ways... ;) those are just the first that crossed my mind

    commented on Jul 8 2011 8:50AM
    Nikola Ilijev
    247 · 1% · 181
  • cool, I guess now we can use currency symbols too

    commented on Jul 8 2011 9:10AM
    Nikey Patel
    1978 · 0% · 7
  • Is this useful???

    commented on Jul 8 2011 11:20AM
    Christian Sanabria
    2893 · 0% · 2
  • csanabria, it is useful it you want to ask a tricky interview question

    commented on Jul 11 2011 1:08AM
    Madhivanan
    3 · 39% · 12430
Previous 1 | 2 Next

Your Comment


Sign Up or Login to post a comment.

"How will you produce zero without using any numbers?" rated 5 out of 5 by 2 readers
How will you produce zero without using any numbers? , 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]