0
ALTER PROCEDURE [dbo].[K_FS_GetFEEDMRPDetails]
AS
BEGIN
SET NOCOUNT ON;
Select
FT.FeedType,
round(MR.rateperkg, 3) as rateperkg,
round(MR.rateper50kg, 3)as rateper50kg
from
K_FS_FeedMrpDetails MR
inner join
k_FPS_FeedType FT on FT.sno = MR.feedtype
where
date = convert(varchar(10), getdate(), 101)
END
此查詢顯示今日插入的數據。這是正確的,但我也想,如果今天沒有輸入任何數據,我想顯示上次輸入的數據。我怎樣才能做到這一點?請幫幫我......如何在SQL Server中獲取不同條件的數據?
從什麼表的日期列where子句屬於? – Jade
僅K_FS_FeedMrpDetails。 – santhosha