Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

How The Query display the resul

$
0
0

HI ALL,

How the query give the result.

select * from Branch

Table data is

DENABANK1 1900-01-01 00:00:00.000
ANDHRABANK2 1900-01-01 00:00:00.000
ICICIBANK       3        1900-01-01 00:00:00.00

--1--

declare @n varchar(20)
set @n='denabank'
select * 
from Branch 
where (Name=@n or @n='ALL')

O/p is

DENABANK1 1900-01-01 00:00:00.000

--2--

declare @n varchar(20)
set @n='all'
select * 
from Branch 
where (Name=@n or @n='ALL')

o/p

DENABANK1 1900-01-01 00:00:00.000
ANDHRABANK2 1900-01-01 00:00:00.000
ICICIBANK3 1900-01-01 00:00:00.000

How it show all the records.

Please help me.

Regards,

S.Krishna.


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>