这是我的表,即 book_master,具有以下详细信息
id book_nmae book_cost publish_date
6 maths 150.0000 1992-08-06
7 science 120.0000 1992-08-07
8 gujrati 100.0000 1992-08-08
9 english 105.0000 1992-08-09
10 social study 100.0000 1992-08-10
在这里,我想使用 book_name 列获取 publish_date 1992-08-06 和 1992-08-07 之间的差异。
我已经尝试了以下条件到 sql
SELECT DATEDIFF(DAY,book_master.publish_date,book_master.publish_date)
from book_master where book_name in('science','maths')
select DATEDIFF(DAY,book_master.publish_date.book_name('maths'),book_master.publish_date.book_name('science'))
from book_master
问候 rajdeep parmar