Question:
Good evening, is there an analogue of the MySql: = operator in Sqlite, there is just a request, if there is one?
SELECT DISTINCT
NamePrefix,
MiddleName,
Surname,
@curField := FieldTypeId AS FieldTypeId,
(SELECT GROUP_CONCAT(ValueTypeId)
FROM Field
WHERE FieldTypeId = @curField) AS ValueTypeId,
(SELECT GROUP_CONCAT(Value)
FROM Field
WHERE FieldTypeId = @curField) AS Value
FROM ` FieldsToContact`
INNER JOIN `Field` ON FieldsToContact.FieldId = Field.Id
INNER JOIN `Contact` ON FieldsToContact.ContactId = Contact.Id
Answer:
SQLite does not support creating variables (discussion here ).
If you really need variables, then here is a way to achieve a similar effect using a temporary table, but in general it is easier to rebuild the query, as suggested by Mike in the comment to the question, or run multiple queries while keeping the variables in the code.