Tuesday, January 12, 2016

Selects 1 Examples

use CommunityAssist

Select * from Person;

Select PersonFirstName as [First Name], PersonLastName [Last Name], PersonUserName as [User Name]
From Person
Order by PersonLastName Desc, PersonFirstName Desc;

Select * From PersonAddress
Where City='Kent';

Select * From PersonAddress
Where Not City='Seattle';

Select * From PersonAddress
Where City !='Seattle';

Select * From PersonAddress
Where City <>'Seattle';

Select * From PersonAddress 
Where Apartment is not null
And (City ='Seattle' Or City ='Bellevue');

Select GrantKey, GrantAmount, GrantAllocation from ServiceGrant
Where GrantAmount>GrantAllocation;


Select * From ServiceGrant
Where GrantDate Between '2013-08-09' and '2013-08-09';

Select PersonLastName 
from Person 
where PersonLastName like '_anner_';

Select Distinct Top(5) GrantAmount from ServiceGrant
Order by GrantAmount desc;


Select Distinct  GrantAmount from ServiceGrant
Order by GrantAmount desc
Offset 5 rows Fetch next 5 rows only;








No comments:

Post a Comment