471,852 Members | 839 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

How to return table based on if condition in Postgesql

CREATE Procedure [dbo].[GetMstDropdowndata]
@FieldType varchar(100)='Typeid'
AS
BEGIN
if @FieldType='IsOptionalid'
BEGIN
SELECT 'Yes' as ddlvalue,'Yes' AS ddltext
union
SELECT 'No' as ddlvalue,'No' AS ddltext
END
else if @FieldType='Categoryid'
BEGIN
select [CategoryId] as ddlvalue ,[CategoryName] as ddltext
from [CategoryMaster] order by CategoryName
END
END

How to convert above sp in Postgresql
Sep 21 '21 #1
0 4193

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Sreeneet | last post: by
6 posts views Thread by dummie_q | last post: by
16 posts views Thread by Malcolm McLean | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.