Query

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Query as PDF for free.

More details

  • Words: 199
  • Pages: 2
select isdate('2006-2-28') select getdate() select convert(varchar,day(getdate())) declare @testval int set @testval = 6 select case @testval when 1 then 'first' when 2 then 'second' when 3 then 'third' else 'other' end declare @testval int set @testval = 5 select case when @testval <=3 then 'top 3' else 'other' end

cast and convert the cast and convert functions are very similar: both translate a value from one data type to another. although their performance is also similar, their syntax and potential usage is slightly different. both cast and convert have a straightforward syntax: cast(expression as new_data_type) convert(new_data_type, expression, [style])

public static void sum(int a, int b) { console.writeline("the sum of elements {0} and {1} is {2}",a,b,a + b); } public static void sumref(ref int a, ref int b) { a = 4; b = 6; console.writeline("the sume of elements {0} and {1} is {2}",a,b,a + b); }

public static int sumout(int a, int b, out int sum1)

{ sum1 = a+b; console.writeline("the sum1 of elements {0} and {1} is {2}",a,b,a+b); return sum1; }

select charindex('s','srinivasan') select substring('srinivasan',1,9) declare @a int set @a=10 declare @b int set @b = 20 declare @c int set @c = @b / @a print @c

Related Documents

Query
October 2019 37
Query
November 2019 32
Query
October 2019 34
Query
October 2019 31
Query
November 2019 27
Query
December 2019 14