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
Enlist the data types that can be used in pl/sql?
Explain table and field in sql?
Can one improve the performance of sql*loader? : aql loader
Is join an inner join?
Can we use view in stored procedure?
Why indexing is needed?
What does t sql mean?
how to increment dates by 1 in mysql? : Sql dba
What is foreign key sql?
How do you modify a table in sql?
Why do we need databases?
table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
explain the difference between myisam static and myisam dynamic. : Sql dba
What is sql procedures and functions?
what is a trigger in mysql? Define different types of trigger. : Sql dba