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
Does pl/sql support create command?
How to raise user-defined exception with custom sqlerrm ?
Can a table contain multiple primary key’s?
who introduced sql?
Which certification is best for sql?
how many groups of data types? : Sql dba
Is left join inner or outer?
What are stuff and replace function?
What sql database should I use?
What do you know by pl/sql cursors?
What is user defined functions?
Is sql free?
what is 'mysqladmin' in mysql? : Sql dba
Is coalesce faster than isnull?
What is the difference between partitioning and sharding?