Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is a sub query?how will you calculate working days in
a month using sub query?

Answer Posted / p.rajasekar

ex
1)Method
Table tab1 data like Followings

Month date1 Working
Jan 1 0
Jan 1 1
Jan 1 1
Jan 1 0
.
.
.

Then the query should be

select Month,count(Working) from monthname m where working=1
group by Month,working

You will get answer 2;
2 Method

If we store the working days in same column

eg like(1=>Denotes Working,0=>denotes off)
Month Day1
Jan 101010101111



select Month,length(trim(replace(b.Day1,'0','')))
NoofWorkDays from workdays b


Please test it.Let me know the feed back

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of sql? Explain

1090


What is foreign key and example?

926


what is a table in a database ? : Sql dba

1028


What are the most important characteristics of pl/sql?

1144


What operators deal with null?

1097


Is pl sql and postgresql same?

1114


how to get a list of columns in an existing table? : Sql dba

953


How can triggers be used for the table auditing?

1064


Why do we need pl sql?

964


Is t sql a programming language?

1055


What does count (*) do in sql?

997


what is oltp (online transaction processing)? : Sql dba

1070


How much does sql cost?

986


Is it possible to sort a column using a column alias?

1034


How can I delete duplicate rows?

1004