-3

I have a table with columns name and email. The table has 10 records. I want to send an email for all the records. What is the query for that?

sstan
  • 35,425
  • 6
  • 48
  • 66
  • Your question title will achieve the same functional result as the DISTINCT statement. But the latter spares you from having to use aggregates unnecessarily. http://stackoverflow.com/questions/164319/is-there-any-difference-between-group-by-and-distinct – ne1410s Dec 06 '14 at 07:38

2 Answers2

0

Try this:

SELECT DISTINCT email FROM emp 
Saharsh Shah
  • 28,687
  • 8
  • 48
  • 83
0

Try this:

SELECT CONCAT(DISTINCT email, ';')
FROM emp

Will output like: abc@gmail.com;pqr@yahoo.com... in one column

SMA
  • 36,381
  • 8
  • 49
  • 73