title: Error in Querying Concatenation of 2 fields in LibreOffice Base SQL
body: <p>My apologies for wrong terminilogies, I am not actually a programmer, just a Base user confronted with a problem.</p>
  
  <p>I'm having trouble querying a column which is supposed to be a concatenation of two fields of two separate tables. I'm using LibreOffice Base Version 1:3.6.2 and it has the default HSQL engine.</p>
  
  <p>My two tables are as follows: </p>
  
  <p>Table 1 is named <code>"Prefectures"</code> and has the following fields: ID, <code>"Prefecture Name"</code>, and <code>"State"</code>
  Table 2 is named <code>"Ward"</code> and has the following fields: ID, <code>"Ward Name"</code>, and Prefecture ID which is a foreign key referencing table 1.</p>
  
  <p>What I want my query to produce is these two colums: "Ward Name, Prefecture Name" as a concatenation of the Ward.WardName and Prefecture.PrefectureName, and the Ward ID</p>
  
  <p>For example. If I had a prefecture named "Cebu" and a ward named "Lahug" which has a ward ID of 0, I want the query to come up with "Lahug, Cebu" on column 1, and "0" in column 2</p>
  
  <p>The Base tutorial I used seems to have a modified language compared to the actual HSQL language, at least based on my programmer friends reaction. I know that attributes are referred to as <code>Table.Attribute</code>, for example, but in Base, they use <code>"Attribute"</code>, or, if I am not mistaken, when one needs to specify the table of origin, <code>"Table"("Attribute")</code>. However, I know that this modified language works because I used it to create the my two tables.</p>
  
  <p>Anyways, hazarding on what I learned from Base the tutorial document, I came up with:</p>
  
  <pre><code>SELECT "Ward Name" || ', ' || "Prefecture Name" AS "Wrd_Pref",
         "Ward ID"
  FROM "Prefecture" INNER JOIN "Ward" ON "Prefecture" ("Prefecture ID") = "Ward" ("Prefecture ID")
  ;
  </code></pre>
  
  <p>And the error message that came up was:
  "The data content could not be loaded. Access is denied: PREFECTURE in statement [the whole code above]"</p>
  
  <p>I have a suspicion this is a misread due to wrong syntax on my part. Perhaps my guess on using perentheses in this case is wrong? If so, why is the error message "Access denied"? I checked both the records and the sql codes of the two tables, both were perfectly normal.</p>
  
  <p>EDIT: No, I don't want to just split the two fields. I need them concatenated as I am going to use them as list items in a dropdown list for a form I am making.</p>