# Simple SQL Query

Allows simple boolean logic to be applied to a search parameter eg

- Comment contains lymphoma
- First name matches john
- Last name begins with jon$

The simple sql function can be used alone, or in combination with the main form search fields. Note that if used in combination with the main form, no attempt is made to 'sanitise' the search, so for example it is possible to construct a search such as NHS number = 1111111111 and NHS number begins with 222. In this case, the conflicting situation is resolved by the main form field taking precedence over the simple sql search field. Use of the same search field in both main form and simple sql search sections is not currently supported.

Due to the dynamics of sql table indexing, some search parameters (eg 'contains') will incur a performance penalty.

$ - which would return the same results as entering the same term in the Last Name field of the main search form, as 'name' searches here are effectively constructed as 'begins with'.