# If statement help

**URL:** https://forum.kirupa.com/t/if-statement-help/204210
**Category:** Uncategorized
**Created:** [October 18, 2006, 12:34am UTC](https://forum.kirupa.com/t/if-statement-help/204210 "2006-10-18T00:34:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Flash\_Man1](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@Flash\_Man1](https://forum.kirupa.com/u/Flash_Man1)
#### Post date: [October 18, 2006, 12:34am UTC](https://forum.kirupa.com/t/if-statement-help/204210/1 "2006-10-18T00:34:36Z")

</div>

here is my mysql query so far and it says i have a syntax error near the if statement:

```auto
SELECT * FROM questions WHERE questionid <> email
BEGIN
IF questionid = email
END IF

```

Basically its meant to select all the questions that the email is not linked to (or viewed)

any ideas i’ve been checking the refrence manual on [www.mysql.com](http://www.mysql.com) version 5.1 but its all confusing to me ☹
