Hi,
Thank you for your query. Kindly check is the below sql is correct or not :
update books set book_cat=1 where book_name='.Net'
update books set book_cat=2 where book_name='Oracle'
update books set book_cat=3 where book_name='Java'
update books set book_cat=4 where book_name='PHP'
and :
select * from books
where
(
day in ('D','x')
and
book_cat in
(
select distinct book_cat
from books where day in ('D')
or day like
'%' + SUBSTRING(DATENAME(DW, GETDATE()), 1, 3) + '%'
)
or day like
'%' + SUBSTRING(DATENAME(DW, GETDATE()), 1, 3) + '%'
)
It is giving me required output, I just request to please check and reply if it is right/wrong/it depend.
Regards
Girish Sharma