Okay
  Public Ticket #1789286
Search not working - issues creating a "View"
Closed

Comments

  • Komplexideas started the conversation

    I've created a Custom Post Type which I want to make a table of. When I do so, the Search function doesn't work. I realize I have to create a view. However, when doing so, I receive the error "The SELECT statement cannot contain a subquery in the FROM clause." Assistance with a work around would be greatly appreciated. Thanks.

  •  471
    Isidora replied

    Hi Komplexideas,
    Thank you for your purchase.

    As MySQL documentation on create view statement says:

    A view definition is subject to the following restrictions:
    Before MySQL 5.7.7, the SELECT statement cannot contain a subquery in the FROM clause.

    This means, that choosing a MySQL v5.7.7 or newer or upgrading the existing MySQL instance to such a version, would remove this restriction on views completely.

    However, if you have a current production MySQL version that is earlier than v5.7.7, then the removal of this restriction on views should only be one of the criteria being assessed while making a decision as to upgrade or not. Using the workaround techniques described in the other answers may be a more viable solution.

    On website stackoverflow.com you can find a lot of useful examples how you can solve this issue changing your query that is used in that view.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables