[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



select alarm.alarm_id as alarm_id , notification.alarm_id as
notification_id,
location.location_id as location_id ,
escalation.escalation_id from alarm
left join notification on alarm.alarm_id = notification.alarm_id
left join console on alarm.console_id = console.console_id
left join ens on console.ens_id = ens.ens_id
left join location on ens.location_id = location.location_id
left join notification_dispatch on location.location_id =
notification_dispatch.location_id
left join notification_group on
notification_dispatch.notification_group_id =
notification_group.notification_group_id
left join notification_group_escalation on
notification_group.notification_group_id =
notification_group_escalation.notification_group_id
left join escalation on notification_group_escalation.escalation_id =
escalation.escalation_id
where notification.alarm_id is NULL and alarm.status_id = 1 ;
+----------+-----------------+-------------+---------------+
| alarm_id | notification_id | location_id | escalation_id |
+----------+-----------------+-------------+---------------+
|        5 |            NULL |           1 |             1 |
|        5 |            NULL |           1 |             2 |
|        5 |            NULL |           1 |             3 |
|        6 |            NULL |           1 |             1 |
|        6 |            NULL |           1 |             2 |
|        6 |            NULL |           1 |             3 |
|        7 |            NULL |           1 |             1 |
|        7 |            NULL |           1 |             2 |
|        7 |            NULL |           1 |             3 |
|        8 |            NULL |           1 |             1 |
|        8 |            NULL |           1 |             2 |
|        8 |            NULL |           1 |             3 |
|        9 |            NULL |           1 |             1 |
|        9 |            NULL |           1 |             2 |
|        9 |            NULL |           1 |             3 |
|       10 |            NULL |           1 |             1 |
|       10 |            NULL |           1 |             2 |
|       10 |            NULL |           1 |             3 |
|       11 |            NULL |           1 |             1 |
|       11 |            NULL |           1 |             2 |
|       11 |            NULL |           1 |             3 |
|       12 |            NULL |           1 |             1 |
|       12 |            NULL |           1 |             2 |
|       12 |            NULL |           1 |             3 |
+----------+-----------------+-------------+---------------+



There are 3 rows for alarm 4 and I really only need to notify the users
in the first escalation_id.  Is there a SQL function that will only give
me the first row of each alarm since here I do not need the other 2?

Chris






~                                         

On Wed, 2004-04-28 at 10:49, Jason Etheridge wrote:
> Fletch wrote:
> > If you want a more B&D OO, look at Python or Java; between the two I
> > probably dislike the former less.
> 
> I had never heard of B&D before.  That's funny (the acronym, though I'm 
> funny too). :D
> 
> -- Jason
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01252" href="msg01252.html">[ale] Organizing data / SQL Question</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01209" href="msg01209.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01212" href="msg01212.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01213" href="msg01213.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01220" href="msg01220.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01221" href="msg01221.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01224" href="msg01224.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01227" href="msg01227.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
<li><strong><a name="01229" href="msg01229.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01236" href="msg01236.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
<li><strong><a name="01242" href="msg01242.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01244" href="msg01244.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01246" href="msg01246.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01247" href="msg01247.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01248" href="msg01248.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
<li><strong><a name="01249" href="msg01249.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01250.html">[ale] Organizing data</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01252.html">[ale] Organizing data / SQL Question</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01249.html">[ale] Organizing data</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01252.html">[ale] Organizing data / SQL Question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01251"><strong>Date</strong></a></li>
<li><a href="threads.html#01251"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>