Question: I am updating a C# WPF .NET 4.0 application, which is using `BackroundWorker` in order to keep the UI responsive. Should I upgrade it to .NET 4.5 to get async await features or keep .NET 4 and use the TPL. The app is going to be updated frequently and all relative components are availible in .NET 4.5.

Answer: 
The following query will result in one 1 if the value exists in the table:

```
SELECT DISTINCT 1 FROM product_meta WHERE categorie_heading="material";

```

if the column has atleast one row with 'material' in it, 1 will be returned else null.
You are checking the condition and later selecting everything without checking condition. If you want just if it exits or not use this:

```
CREATE PROCEDURE getSearchFilter(IN searchname varchar(220),categoryid int, categoryheading varchar(220),catdiscription varchar(220))
DETERMINISTIC
BEGIN 
if SELECT IF( EXISTS(SELECT distinct categorie_heading FROM product_meta_data WHERE categorie_heading='material'), 1, 0) then

SELECT 'True'
else
SELECT 'False'
end if;

END

```

If you want to see the results if it exists, use it this way:

```
CREATE PROCEDURE getSearchFilter(IN searchname varchar(220),categoryid int, categoryheading varchar(220),catdiscription varchar(220))
    DETERMINISTIC
    BEGIN 
    if SELECT IF( EXISTS(SELECT distinct categorie_heading FROM product_meta_data WHERE categorie_heading='material'), 1, 0) then

    SELECT distinct categorie_heading FROM product_meta_data WHERE categorie_heading='material';
    else
    //you can select a value here or not
    end if;

    END

```