Question:
SQL Query Question?
Luv Peace
2007-05-10 13:47:05 UTC
I have created multiple SQL queries that extract information from the tables and create reports. however, I want to send only one email to the person running the query instead of sending multiple reports for the number of queries within the job. Any Ideas how I can do that?
Five answers:
Manzana verde
2007-05-10 18:34:46 UTC
As far as I know, no 'regular' query can send an email. except if you're using SQL server.

check out this site :

http://www.sqlteam.com/item.asp?ItemID=5003
Meghan
2016-04-01 09:35:32 UTC
The best book that taught me everything about MySQL is "MySQL Crash Course" by Ben Forta. The book is very straightforward, it shows the keyword, an example query, and an example output. I know you're asking for SQL, not MySQL. Most SQL are similar, and it's only a matter of knowing the few differences of each one. I would start here.
afhood123
2007-05-14 04:50:57 UTC
sometimes I have to make a single output from sql although it uses many different data. My advise is to union the queries into a single output. Name the column names something generic and have the data be self explanatory. See below:



select

a.a as column1,

a.b as column2,

a.c as column3

from

table1 a



union



select

b.a as column1,

b.b as column2,

null as column3 /*don't have any data for this column in this query*/

from

table2 b
kedarnath c
2007-05-10 13:50:45 UTC
1. write another query to send e-mail.

2. Send e-mail on execution of last query.
thekillerkat
2007-05-10 13:51:41 UTC
you can easily combine multiple queries...



.

.

.

can u be more clear plz..


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...