我有桌子,其中我有酒店名称,但有些栏目有Null
酒店名称。现在我想只获得那些具有酒店名称的列,或者我不想从表中获取空列值。
我写的存储过程是
Alter PROCEDURE [dbo].[p_Get_HotelNamess]
AS
BEGIN
SET NOCOUNT ON;
SELECT
Hotel_Info.Hotel_Name, Hotel_Info.HotelID
FROM
Hotel_Info
END
答案 0 :(得分:3)
你应该试试这个
Alter PROCEDURE [dbo].[p_Get_HotelNamess]
AS
BEGIN
SET NOCOUNT ON;
SELECT
Hotel_Info.Hotel_Name, Hotel_Info.HotelID
FROM Hotel_Info
WHERE Hotel_Info.Hotel_Name IS NOT NULL
END