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

How does postgresql compare to oracle/db2/ms sql server/informix?

1039


What are the benefits of pl/sql packages?

1107


what are the differences between binary and varbinary? : Sql dba

1049


Why query optimization is needed?

930


Why do we use cursors?

994


What does select * from mean in sql?

3248


What are sql functions? Describe in brief different types of sql functions?

1105


What are the two different parts of the pl/sql packages?

1091


Explian rowid, rownum?

1021


What is pl sql variable?

997


Does sql*plus have a pl/sql engine?

1078


What is the purpose of design view?

1010


What does the acronym acid stand for in database management?

1034


What is difference between my sql and sql?

1079


What is a column in a table?

1130