MySQL SELECT query: i want show duplicated entries

MySQLselect

Example

My query is:

SELECT code_CAT FROM categories WHERE id_code IN(14,14,14,14);

output is:

53724

Only one row.

Instead I want this output:

53724
53724
53724
53724

How can I achieve this? I want this because I need to use the records on an Excel Spreadsheet.

Best Answer

If you really need it (I don't get why though), you can do

SELECT code_CAT 
FROM categories a
INNER JOIN 
(
  select 14 as id_code
  UNION ALL
  select 14
  UNION ALL
  select 14
  UNION ALL
  select 14
)b ON (a.id_code = b.id_code)