You are on page 1of 3

Note

1. Here Please change the table Name KudlerCOA to your tablename.

This view will give the list of records


SELECT Account, COUNT(*) AS numberofAccounts FROM KudlerCOA GROUP BY Account HAVING (COUNT(*) > 1) -- This view will give the list of records where short_Description='Bank Account' SELECT Account, Description, Short_Description, Balance FROM KudlerCOA WHERE (Short_Description = 'Bank Account') -- This view will give the list of records where Balance greater than 10000 SELECT Account, Description, Short_Description, Balance FROM KudlerCOA WHERE (Balance > 10000) -- This view will calculate the sum of balance of all the account SELECT Account, SUM(Balance) AS TotalBalance FROM KudlerCOA GROUP BY Account --This view will show all the details like description, short description, and balance and Totalbalance of Account = 100001 SELECT Account, SUM(Balance) AS TotalBalance, Description, Short_Description, Balance FROM KudlerCOA WHERE (Account = 100001) GROUP BY Account, Description, Short_Description, Balance

--This will display record by account=100001 Select Account,Description,Short_description,Balance from KudlerCOA Where Account=100001

SELECT Account, SUM(Balance) AS TotalBalance, Description, Short_Description, Balance FROM KudlerCOA WHERE (Account = 100001) GROUP BY Account, Description, Short_Description, Balance

SELECT Account, SUM(Balance) AS TotalBalance FROM KudlerCOA WHERE (Account = 100001) GROUP BY Account

This view will give the list of records


Create View View1 As SELECT Account, COUNT(*) AS numberofAccounts FROM KudlerCOA GROUP BY Account HAVING (COUNT(*) > 1)

-- This view will give the list of records where short_Description='Bank Account' Create View View2 As SELECT Account, Description, Short_Description, Balance FROM KudlerCOA WHERE (Short_Description = 'Bank Account')

-- This view will give the list of records where Balance greater than 10000 Create View View3 As SELECT Account, Description, Short_Description, Balance FROM KudlerCOA WHERE (Balance > 10000)

-- This view will calculate the sum of balance of all the account Create View View4 As SELECT Account, SUM(Balance) AS TotalBalance FROM KudlerCOA GROUP BY Account

--This view will show all the details like description, short description, and balance and Totalbalance of Account = 100001 Create View View5 As SELECT Account, SUM(Balance) AS TotalBalance, Description, Short_Description, Balance FROM KudlerCOA WHERE (Account = 100001) GROUP BY Account, Description, Short_Description, Balance

--This will display record by account=100001 Create View View6 As Select Account,Description,Short_description,Balance from KudlerCOA Where Account=100001

You might also like