[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Wed Apr 28 10:56:49 2004 -->
- <!--x-from-r13: psbjyre ng bhgcbfgfragvary.pbz (Quevf Tbjyre) -->
- <!--x-message-id: 1083164114.18749.236.camel@devel -->
- <!--x-reference: 1083110917.17415.153.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1083126767.18748.179.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1083154714.17392.188.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1083160872.18751.226.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1083161577.17387.231.camel@devel -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Organizing data / SQL Question -->
- <li><em>date</em>: Wed Apr 28 10:56:49 2004</li>
- <li><em>from</em>: cfowler at outpostsentinel.com (Chris Fowler)</li>
- <li><em>in-reply-to</em>: <<a href="msg01249.html">[email protected]</a>></li>
- <li><em>references</em>: <1083110917.17415.153.camel@devel> <<a href="msg01212.html">[email protected]</a>> <1083126767.18748.179.camel@devel> <<a href="msg01220.html">[email protected]</a>> <1083154714.17392.188.camel@devel> <<a href="msg01224.html">[email protected]</a>> <<a href="msg01227.html">[email protected]</a>> <<a href="msg01229.html">[email protected]</a>> <<a href="msg01236.html">[email protected]</a>> <<a href="msg01242.html">[email protected]</a>> <1083160872.18751.226.camel@devel> <<a href="msg01246.html">[email protected]</a>> <1083161577.17387.231.camel@devel> <<a href="msg01248.html">[email protected]</a>> <<a href="msg01249.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Organizing data / SQL Question</li>
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
> <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>