title: dbGetQuery select all existing columns
body: <p>I have a vector of columns that I would like to select from the databases. If the column is missing, I want to select all of the columns that exists. But, I am not sure how to specify this in my query?</p>
  <p>For example, to select column <code>drat</code> I specify <code>&quot;SELECT drat FROM mtcars&quot;</code>. Let's say my column names are <code>drat</code> and <code>colMissing</code>.</p>
  <p>My query does not work <code>&quot;SELECT drat, colMissing FROM mtcars&quot;</code> as <code>Error: no such column: colMissing </code>.</p>
  <p>However, I want <code>drat</code> exporting. How can I make sure that all existing columns will be exported, and non existing skipped? In my real data, I have a long vector of columns names and many databases, so I want to do it automatically.</p>
  <p>Dummy example:</p>
  <pre><code>library(DBI)
  
  con &lt;- dbConnect(RSQLite::SQLite(), &quot;:memory:&quot;)
  
  dbWriteTable(con, &quot;mtcars&quot;, mtcars)
  dbGetQuery(con, &quot;SELECT * FROM mtcars&quot;) # select all columns
  dbGetQuery(con, &quot;SELECT drat, wt, disp, colMissing FROM mtcars&quot;, n = 6)  # does not work as contains non existing columns name. How to export only existing ones?
  </code></pre>