I have the following table

```
+-------+-------+-------+
|  ID   | Name1 | Name2 |
+-------+-------+-------+
|      1| Steve | Steven| - true
|      1| Steven| Steve | - true
|      1| Max   | Steve | - false
|      1| Steve | Steve | - true
+-------+-------+-------+

```

and i need to determine rows, where `Name1` starts with `Name2` or `Name2` starts with `Name1`

**question:**

is there a better way than `Name2 LIKE Concat(Name1, '%') OR Name1 LIKE Concat(Name2, '%')`

this example is a bit simplified, because `Name1` is a huge subselect and something like `Concat(Name1, '%') LIKE Concat(Name2, '%')` would increase the performance of my application a lot

**update:**

to point out my problem, the complete select looks like 

`(SELECT Name FROM User JOIN UserGroup ON User.UserID = UserGroup.UserID JOIN Company ON Company.UserID = User.UserID WHERE UserGroup.Range > 2 AND User.Create > '2010-01-01' AND Company.Country = 'CH' ORDER BY User.StartDate DESC LIMIT 1) AS Name2`

so the statement from above looks like 

`(SELECT Name FROM User JOIN UserGroup ON User.UserID = UserGroup.UserID JOIN Company ON Company.UserID = User.UserID WHERE UserGroup.Range > 2 AND User.Create > '2010-01-01' AND Company.Country = 'CH' ORDER BY User.StartDate DESC LIMIT 1) LIKE Concat(Name1, '%') OR Name1 LIKE Concat((SELECT Name FROM User JOIN UserGroup ON User.UserID = UserGroup.UserID JOIN Company ON Company.UserID = User.UserID WHERE UserGroup.Range > 2 AND User.Create > '2010-01-01' AND Company.Country = 'CH' ORDER BY User.StartDate DESC LIMIT 1), '%')`

and the select is called twice - there must be a way to fetch `Name2` only once from the database