I need to select a different value from a query depending upon whether or not a certain part of the WHERE clause matches a result, or doesn't. While I have the logic of what needs to be accomplished figured out, I have absolutely no idea how to notate it in a MySQL-friendly way!

**Consider the following pseudo-code:**

```
SELECT table_name.*, `match_type`
FROM table_name
WHERE
    (
    IF THIS MATCHES:
    'input' LIKE CONCAT('%', `value`, '%');

    THEN
    `match_type` equals 1

    ELSEIF THIS MATCHES:
    `value` LIKE CONCAT('%', 'input', '%')

    `match_type` equals 0
    )

```

If that first match finds any results, then I need to return the `match_type` column with a value of 1.

Otherwise, move on to the second test. If that second match returns any results, then I need the `match_type` column to instead have a value of 0.

If neither matches, nothing should be returned. The only possible options for `match_type` should therefore be 1 or 0.

---

*How would I go about accomplishing this?*

Thanks for your help!