Subject different resultsets for very similar SQL
Author d_dude_2003
One SELECT is

SELECT MOC_ITEMS.MOCITEMID, PARTIES.NAME
FROM MOC_ITEMS INNER JOIN UARCUSERS ON MOC_ITEMS.CURRENTOWNER =
UARCUSERS.USERID
INNER JOIN PARTIES ON MOC_ITEMS.PID = PARTIES.PARTYID
INNER JOIN MOC_CATEGORIES ON MOC_ITEMS.MOCCATEGORYID =
MOC_CATEGORIES.MOCCATEGORYID
INNER JOIN MOC_SUBCATEGORIES ON MOC_ITEMS.MOCSUBCATEGORYID =
MOC_SUBCATEGORIES.MOCSUBCATEGORYID
ORDER BY PARTIES.NAME ASC

Another one is

SELECT
MOC_ITEMS.MOCITEMID,
MOC_ITEMS.MOCCATEGORYID,
MOC_ITEMS.MOCSUBCATEGORYID,
MOC_ITEMS.STATUSID,
MOC_ITEMS.PRIORITYID,
MOC_ITEMS.ACCESSSTATUSID,
MOC_ITEMS.CURRENTOWNER,
MOC_ITEMS.LASTOWNER,
MOC_ITEMS.SENDERPARTYID,
MOC_ITEMS.SENDERPERSONID,
MOC_ITEMS.RECIPIENTPARTYID,
MOC_ITEMS.RECIPIENTPERSONID,
MOC_ITEMS.CORRESPONDENCETYPE,
MOC_ITEMS.DATEOFCORRESPONDENCE,
MOC_ITEMS.DATERECEIVED,
MOC_ITEMS.DATEENTERED,
MOC_ITEMS.ENTEREDBY,
MOC_ITEMS.KEYWORDS,
MOC_ITEMS.DOCUMENTID,
MOC_ITEMS.LETTERNUMBER,
MOC_ITEMS.REFERREDNUMBER,
MOC_ITEMS.SUBJECT,
MOC_ITEMS.COPIED,
MOC_ITEMS.INVOICENUMBER,
MOC_ITEMS.PONUMBER,
MOC_ITEMS.PACKAGECONTENTS,
MOC_ITEMS.INVOICEDUEDATE,
MOC_ITEMS.REPLYITEMID,
MOC_ITEMS.INREPLYTOITEMID,
MOC_ITEMS.PROPOSEDVOLUMENUMBER,
MOC_ITEMS.VOLUMENUMBER,
MOC_ITEMS.FILEDBY,
MOC_ITEMS.FILEDON,
MOC_ITEMS.KEYWORDSLINE,
MOC_ITEMS.FILINGSTATUS,
MOC_ITEMS.ACCEPTED,
MOC_ITEMS.ATTACHMENT,
MOC_ITEMS.PACKAGECONTENTSLINE,
MOC_ITEMS.SUBJECTID,
MOC_ITEMS.DRAFT,
MOC_ITEMS.DRAFTFINALIZED,
MOC_ITEMS.DUEDATETIME,
MOC_ITEMS.REMINDERDATETIME,
MOC_ITEMS.DUEDATE,
MOC_ITEMS.PID,
MOC_CATEGORIES.CATEGORY,
MOC_SUBCATEGORIES.SUBCATEGORY,
PARTIES.NAME,
UARCUSERS.USERNAME
FROM MOC_ITEMS INNER JOIN UARCUSERS ON MOC_ITEMS.CURRENTOWNER
= UARCUSERS.USERID
INNER JOIN PARTIES ON MOC_ITEMS.PID = PARTIES.PARTYID
INNER JOIN MOC_CATEGORIES ON MOC_ITEMS.MOCCATEGORYID =
MOC_CATEGORIES.MOCCATEGORYID
INNER JOIN MOC_SUBCATEGORIES ON MOC_ITEMS.MOCSUBCATEGORYID =
MOC_SUBCATEGORIES.MOCSUBCATEGORYID
ORDER BY PARTIES.NAME ASC

When i am running both in IBExpert, it shows slightly different
resultsets. The order of ID values differs...The same goes when
invoke these SQL from my application.

Can anyone explain, why?

Thanks.