| Author |
Topic |
|
sponguru_dba
Yak Posting Veteran
93 Posts |
Posted - 2005-12-09 : 09:01:03
|
| SELECT mfu.UserUID,mfu.LoginID,mfu.FirstName,mfu.LastName,mfu.Key1,mfu.Key1Desc,mfu.Key2,mfu.Key2Desc,mfu.Role,mfu.RoleDesc,mfu.UserClass,mfu.SkillList,mfu.PrivilegeList,mfu.ZIP,mfu.TZ,mfu.ActivationDate,mfu.DeactivationDate,mfu.PhoneNumber,mfu.FaxNumber,mfu.Email,mfu.Creation,mfu.CreatedBy,mfu.UserUID,mfu.Expiration,mfu.PartitionID,mfu.DST,mfu.Latitude,mfu.Longitude,mfu.LanguageCode,mfu.SessionTimeout,ubu.BUID,bu.BusinessUnitDesc,bu.OrgType,us.RoutingAreaList,us.UserScheduleUID,us.ShiftStartDateTime,us.ShiftStopDateTime,us.ScheduleDate,us.AtWork,us.BreakList,ua.LastLatitude,ua.LastLongitude,ua.StatusHistory,ua.GISTrack,ua.GPSTrack,ua.HHStatusCode,ua.TruckID,ua.GPSUnitID FROM MFUser mfu,UserBU ubu, BusinessUnit bu,UserSchedule us, UserActivity ua WHERE ubu.UserUID = mfu.UserUID AND ubu.BUID = bu.BUID AND ubu.Creation >= mfu.Creation AND ubu.Expiration = mfu.Expiration AND ubu.Creation >= bu.Creation AND ubu.Expiration <= bu.Expiration AND mfu.UserUID = us.UserUID(+) AND mfu.UserUID = ua.UserUID(+) AND us.ScheduleDate(+) = '2005-12-09' AND ua.ActivityDate(+) = '2005-12-09' AND mfu.Expiration = '9999-01-01' ORDER BY mfu.LoginID |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-12-09 : 10:51:14
|
| I think the (+) bit indicate that LEFT JOIN's should be used on these conditions.I've come across this before in PervasiveSQL.Change your "FROM MFUser mfu,UserBU ubu, BusinessUnit bu,UserSchedule us, UserActivity ua"into something like"FROM MFUser mfuINNER/LEFT JOIN UserBU ubu on mfu.y = ubu.xINNER/LEFT JOIN BusinessUnit bu on bu.z = ?"etcputting in INNER or LEFT as appropriate based on the various AND clauses.MOST of the WHERE clause should move up to the "ON" clauses.Have a go yourself and post your efforts for review/correction. |
 |
|
|
|
|
|