How Do I Achieve A "Vlookup" In A Base Query?

I have a set of contacts in a table. I want to create a field either on the fly or a hrd field that concatinates together certain items using SQL or whatever means that are possible. For example …

Table 1 Fields

  • Contact_ID
  • Contact_FName
  • Contact_LName
  • Contact_Address
  • Contact_City
  • Contact_State
  • Contact_Postal
  • Contact_Phone

Let’s assume I want to take make an additional firld called “Contact_Username” and automatically create one based on the information I have (Contact_FName + Contact_LName for simplicity sake). How would I go about that in LibreOffice? I don’t care if this field is on the fly or if it’s just a field in the actual table as long as it can be updated automatically without me doing anything and as long as I can reference it somewhere else - like say in a query.

Try this:

SELECT *, "Contact_FName" || ' ' || "Contact_LName" AS "Contact_Username" FROM "Table 1"