Users Pricing

forum

Home Forums Selecting specific records in a column else all of them – MindStick

Selecting specific records in a column else all of them

Kate Smith 2312 16 Oct 2013

I am building a website in ASP.NET with SQL Server 2012 use in back end.

And I also have drop down boxes that contain the following strings as an example.

<asp:ListItem>abc</asp:ListItem>

<asp:ListItem>zyz</asp:ListItem>

<asp:ListItem>dood</asp:ListItem>               

<asp:ListItem>foo</asp:ListItem>

What sort of SQL command do I need to in order to be able to use logic like this pseduo.

If SelectedItem is 'abc' return all rows in column

ELSE IF

Retrieve records in column where alphabet_text = ListItem.

I dont want to use a simple IF ELSE stored procedure because I have lots and lots of filtering options available and making else seems really badly designed.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md