Bug report #8880
Mysql Query builder
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||not reproducable|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17560|
On clicking on fields in Query builder in where clause a column name appears included in double quotes,
but values - not. To get a right clause, there must be a column names not in quotes and values quoted.
Such, as Weight = 2 OR Name= "City"
#1 Updated by Jukka Rahkonen over 7 years ago
I am sorry but I do not know MySQL nor QGIS well and I want to ask why "there must be a column names not in quotes and values quoted" ? Does this requirement come from MySQL or QGIS side?
If the query was plain ANSI SQL then both alternatives are a bit wrong. Strings are always delimited by single quotes and if delimited identifiers are used then identifiers are between double quotes. From http://www.ibphoenix.com/resources/documents/design/doc_152:
"In the ANSI SQL standard, a string constant can only be delimited by single quotes and a SQL delimited identifier is delimited by double quotes. SQL delimited identifier is case sensitive. For example, table "foo" is different from from table "FoO". But in the case of regular SQL identifier, table fOo is same same table FOO and it is also the same as table "FOO"."
Therefore an ANSI-aware query would look like
SELECT "Algorithm" AS "Algorithm",
"NodeFrom" AS "NodeFrom"
WHERE "Name" = 'DASF';
But as I said, your comment may not deal with SQL at all.