Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-01-18 : 18:00:06
|
yaron benita writes "if I have a recordset that include only three individual record but it select each one of them for several times (so the recordcount is actualy bigger then 3) - what do I need to do to select each record only onese. I think it's done with "distinct" order but I can't find the right syntex so P-lease help me!!!
here is the select scentens:
strsql="SELECT entitylink.enl_masternum AS enl_masternum, Message.*, entity.* "&_ "FROM Message INNER JOIN entitylink ON "&_ "Message.msg_msgnum = entitylink.enl_slavenum AND "&_ " Message.msg_msgtype = entitylink.enl_slavetype INNER JOIN "&_ " entity ON Message.msg_msgnum = entity.ent_entitynum AND "&_ " Message.msg_msgtype = entity.ent_entitytype "&_ " WHERE (entitylink.enl_masternum <> 51) and "&_ "(msg_promo like '%"&texti&"%' or msg_header like '%"&texti&"%' or "&_ "msg_fulldesc like '%"&texti&"%')"&_ " order by ent_creationdate desc, ent_creationtime desc"
the unique record is message.msg_msgnum - I select only three records but they are refered to the "entitylink" table more the onese.
p.s. i'm not questening your knoleg - I know it's an easy one - but still thank you!
MSsql - 7 windows 2000" |
|
|
|
|
|