/    Sign up×
Community /Pin to ProfileBookmark

is it possible to use a sub-query in order by of query section
for-example:

select col1, col2, col3 from sometable order by (select colName from 2ndtable order by name asc) asc

or something like this

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 11.2007 — I do not off-hand know if it is allowed, but if it is, then I would think that the sub-query would need to return only one row with only one value.
Copy linkTweet thisAlerts:
@sstalderDec 12.2007 — No because a sub-query returns values and order by is expecting a field name, not a field value.
×

Success!

Help @mahfooz 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...