I'm working with session variables and I would want to create a view which does the following: 

```
if (myVar=1)
  select * from my_table where X
else
  select * from my_table where Y

```

Where X and Y are different clauses.

Is it possible?

Can this be implemented with a regular select statement (or I need stored procedures)?