-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
  • 33,933
  • 6
  • 42
  • 65
  • 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
  • 27,975
  • 8
  • 43
  • 82
0

Try this:

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

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

SMA
  • 35,277
  • 7
  • 46
  • 71