USE of COALESCE in a Stored Procedure MySQL

use of coalesce USE [DB_Name] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[sp_FillMarks] @studentId bigint AS BEGIN SET NOCOUNT ON; SELECT ID, Name, Marks FROM t_Results r where STUDENTID = COALESCE(NULLIF(@studentId, '0'), STUDENTID) and Marks >= 80 END Explanation This will select details of student whose id is passed to the... Continue Reading →

Blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started