Thursday, 17 October 2013

The most asked Sql Query in Interview

The most asked sql query in interview……………………………………..

//execute query in sql server…………

create database SqlTopQuery
use SqlTopQuery

//create table Record………..

Create table Record(SrNo int primary key,Name nvarchar(50) unique,MobileNo nvarchar(50))

insert into Record values(1,'Kush Tiwari','09451119029')
insert into Record values(2,'Somesh Katiyar','09953760690')
//query for 0 which comes at very first in mobile no is replace with +91-

update Record set MobileNo='+91-'+RIGHT(MobileNo,len(MobileNo)-1) from Record where LEFT(MobileNo,1)='0'


0 comments:

Post a Comment