Concatenate out of SELECT in SQLite

  android, sqlite

I am working with an android application where I need to search my database by full name, I am currently using this, which results in a list with the IDs and with FullName:

    SELECT _id, name || ' ' || lastname AS FullName
    FROM User
    WHERE FullName LIKE "%William Jones%"
    ORDER BY FullName

I know that it is necessary to create the FullName table to perform the search I need, but I would like to know if it is possible to concatenate and search but omit FullName from my result, I want to obtain only ids.

I don’t know if you understand what I need, but I want something like that

    FullName = name || ' ' || lastname
    SELECT _id
    FROM User
    WHERE FullName LIKE "%William Jones%"
    ORDER BY FullName

Source: Android Questions

LEAVE A COMMENT