/    Sign up×
Community /Pin to ProfileBookmark

Merge user lists and ORDER

Is it possible to join 3 tables, two of which contain user names (different users) and then order the list output by alphabetical order?

[code=php]
// table 1
t1.id
t1.event
t1.t2_ID
t1.t3_ID

// table 1
t2.id
t2.t2FirstName
t2.t2LastName

// table 1
t3.id
t3.t3FirstName
t3.t3LastName

// QUERY
SELECT
t1.*,
t2.t2FirstName,
t2.t2LastName,
t3.t3FirstName,
t3.t3LastName
FROM t1
LEFT JOIN t2 ON (t1.t2_ID = t2.id)
LEFT JOIN t3 ON (t1.t3_ID = t3.id)
WHERE t1.event = X
ORDER BY ????? // NEED HELP HERE!
[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @santa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...