phpbar.de logo

Mailinglisten-Archive

Stored Proc. und Subselects ?

Stored Proc. und Subselects ?

Michael Donning mysql-de_(at)_lists.bttr.org
Wed, 23 Jan 2002 08:30:39 +0100


Moin Jörg,

> -----Original Message-----
> "SELECT Messages.ID,[User].Name, Messages.SentAt,  Messages.Message FROM
> [User] INNER JOIN Messages  ON Messages.UserID = [User].ID WHERE
> ChatroomID
> = " & ChatroomID & " AND SentAt >= (SELECT LastMessage FROM User2ChatRoom
> WHERE UserID = " &BenutzernameID & " AND ChatroomID = " & ChatroomID & ")
> ORDER By SentAt"
>

Vorbedingung, es gibt nur einen Eintrag pro UserID+ChatroomID in
User2ChatRoom.
ist Chatroomid in user oder messages?


Ohne Gewähr:
 "SELECT Messages.ID,User.Name, Messages.SentAt,  Messages.Message FROM
 User INNER JOIN Messages  ON Messages.UserID = User.ID,
 User2ChatRoom WHERE
 Messages.ChatroomID = " & ChatroomID & " AND SentAt >=
User2ChatRoom.LastMessage
 And User2ChatRoom.UserID = " &BenutzernameID & " AND
User2ChatRoom.ChatroomID = " & ChatroomID & "
 ORDER By SentAt"

Gruss, Michael Donning

---
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive