title: Android SQLite syntax error near "," On API 21<
body: <p><strong>android.database.sqlite.SQLiteException: near &quot;,&quot;: syntax error (code 1): , while compiling:</strong></p>
  <blockquote>
  <p>SELECT transaction_detail_outlet_id  FROM   order_details
  LEFT OUTER JOIN accounts
  ON order_details.account_id = accounts._id
  AND accounts.account_name = 'asset1andriodx'
  LEFT OUTER JOIN warehouse_skunits_inventory
  ON order_details.transaction_detail_skunit_id =
  warehouse_skunits_inventory.skunit_id
  AND order_details.transaction_detail_from_warehouse_id =
  warehouse_skunits_inventory.warehouse_id
  LEFT OUTER JOIN (SELECT *
  FROM   warehouse_skunits_pricing
  WHERE  ( warehouse_id, skunit_id, skunit_batch_id,
  skunit_price_priority ) IN (
  SELECT
  warehouse_id,
  skunit_id,
  skunit_batch_id,
  Max(skunit_price_priority) AS
  skunit_price_priority
  FROM
  warehouse_skunits_pricing
  GROUP
  BY warehouse_id,
  skunit_id,
  skunit_batch_id)) AS
  warehouse_skunits_pricing
  ON
  order_details.transaction_detail_skunit_id =
  warehouse_skunits_pricing.skunit_id
  AND order_details.transaction_detail_from_warehouse_id =
  warehouse_skunits_pricing.warehouse_id
  LEFT OUTER JOIN skunits
  ON
  order_details.transaction_detail_skunit_id = skunits.skunit_id
  LEFT OUTER JOIN discounts
  ON order_details.transaction_detail_skunit_id =
  discounts.discount_skunit_id
  AND order_details.transaction_detail_outlet_id =
  discounts.discount_outlet_id
  LEFT OUTER JOIN form_type
  ON order_details.transaction_detail_skunit_id =
  form_type.form_type_type_id
  AND form_type.form_type_form_type = 'skunits_order'
  LEFT OUTER JOIN outlet_targets
  ON order_details.transaction_detail_outlet_id =
  outlet_targets.outlet_targets_outlet_id
  AND order_details.transaction_detail_skunit_id =
  outlet_targets.outlet_targets_skunit_id
  LEFT OUTER JOIN batches
  ON  warehouse_skunits_inventory.skunit_id = batches.batch_skunit_id  AND
  warehouse_skunits_inventory.skunit_batch_id = batches.batch_id  WHERE  ( transaction_detail_draft = '0'
  OR transaction_detail_draft = '2' )</p>
  </blockquote>
  <p>Android is giving error once we execute above mentioned query in android version &lt; 21. Same query works in higher android device.</p>
  <p>In app earlier we used <strong>sqlcipher</strong> which we removed now, and it turns out that <strong>sqlcipher</strong> have it's own syntax formatting so it didn't cause any issue for older devices.</p>
  <p>Is sqlite have different syntax for different version of android. Because the sqlite lib is already updated(<strong>&quot;androidx.sqlite:sqlite:2.1.0&quot;</strong>) and it should support db engine of older device as well.(or how does it works based on android version)</p>
  <p>I have updated all double quoted &quot;string&quot; query to 'single' quotes, this is one syntax change i found while experimenting.</p>
  <p>Is there any simple solution to support the same syntax in all android devices?</p>