I have a database with many tables and one particular table has columns:
- name
- no:
- address
- start_date(include time also)
- end_date(include time also)
- id
I need to select only the name and the e-mail addresses of the persons satisfying the condition that:
- he appears twice in the list
- the difference between the time in fields Start_date and end_date must be 10+minutes
You can join the table onto itself like this:
Example
While you loop the results you can easily create valid CSV data using
fputcsv().