How to use FIND_IN_SET() function in drupal database query?

There are two ways:

// 1. Using db_query.
$result = db_query("SELECT * FROM `table_name` WHERE FIND_IN_SET(2, column_name)")->fetchObject();

// 2. Using db_select.
$query = db_select('table_name', 'cst');
$query->fields('cst');
$dborc = db_and();
$dborc->where("FIND_IN_SET(2, cst.column_name) > 0");
$query->condition($dborc);
$result = $query->execute()->fetchAll();


Source: https://www.drupal.org/taxonomy/term/4/feed