1

Below is my query for using FIND_IN_SET to check if the value "1" is in the column "DefinedGroup" which will have comma-separated values

$q=$this->usermanagement->query("
SELECT momentsdetail.id,
       firstname,
       lastname,
       filepath,
       appcreateddate,
       senderid
FROM   momentsdetail
       INNER JOIN users
               ON users.id = senderid
       INNER JOIN moments
               ON moments.id = momentsdetail.momentsid
WHERE  momentsdetail.remarks IS NULL
       AND Find_in_set('1', definedgroup)
ORDER  BY appcreateddate DESC")

Error:

A database error occurred

Error Number:42000/195

[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]'FIND_IN_SET' is not a recognized built-in function name.

Rohan Khude
  • 4,455
  • 5
  • 49
  • 47
Mykel Aballe
  • 235
  • 1
  • 4
  • 15
  • provide your error in text format. – Rohan Khude Oct 31 '16 at 08:12
  • this is the error: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]'FIND_IN_SET' is not a recognized built-in function name. – Mykel Aballe Oct 31 '16 at 08:14
  • Well, as the error says: SQL Server does not know anything about `'FIND_IN_SET`. Seems to be MySql specific. See here for a similar question: http://stackoverflow.com/questions/35725675/sql-server-2014-equivalent-to-mysqls-find-in-set – erg Oct 31 '16 at 14:10

0 Answers0