0

This is my first question, and I1m not sure if Im doing something wrong...

Im working with MYSQL.

The problem is

IN (10,12) returns the values that I want

IN ('10,12') returns only the first value

I think I have the "second" situation on my recordset

How to "fix" it in one select query?

PS: This is my query. SELECT GROUP_CONCAT(gcr.descricao) FROM grupos_contas_relacional gcr WHERE id IN (gce.relacionados)

Leo Nogueira
  • 108
  • 10
  • It isn't clear what your problem is here. Can you post some sample data, along with expected and actual results? –  Jun 17 '15 at 19:02
  • What is your schema for the table and sample data – Drew Jun 17 '15 at 19:02

1 Answers1

0
SELECT GROUP_CONCAT(gcr.descricao) 
FROM grupos_contas_relacional gcr 
WHERE find_in_set(id, gce.relacionados)

But you should actually better change your table design. Never store multiple values in a single column.

juergen d
  • 201,996
  • 37
  • 293
  • 362