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
What is vector point function?
What are inbuilt functions in sql?
What is synonyms?
what are all the different normalizations? : Sql dba
Why self join is used in sql?
Why we use joins in sql?
what happens if null values are involved in expressions? : Sql dba
Does mysql support pl sql?
What is %s in sql?
Explain isolation levels. : Transact sql
How do you know if a relationship is 2nf?
Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?
what is the syntax for using sql_variant_property? : Transact sql
Show how functions and procedures are called in a pl/sql block.
Does sql*plus also have a pl/sql engine?