[wp-hackers] User Meta Query Assistance

DD32 wordpress at dd32.id.au
Wed Jan 16 08:51:48 GMT 2008


Even better!
I wasnt aware that Join conditions could have things like that (Honestly: Stupid me, I knew there could be multiple conditions, just never thought of using a literal in one!)

On Wed, 16 Jan 2008 13:30:02 +1100, Brian Layman <Brian at thecodecave.com> wrote:

> With some minor tweaks, yes...
>
> SELECT ID, user_login, first.meta_value AS fname, last.meta_value AS lname
> FROM wp_users LEFT JOIN wp_usermeta AS first ON (wp_users.ID = first.user_id
> AND first.meta_key = 'first_name') LEFT JOIN wp_usermeta AS last ON
> (wp_users.ID = last.user_id AND last.meta_key = 'last_name')
>
> Nice use of sequential joins!
>
> ______________________________________________
> Brian Layman
> b5media Inc.
> www.b5Media.com / www.TheCodeCave.com
> Skype: BrianLayman
> Twitter: http://www.twitter.com/brianlayman
>
>
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 





More information about the wp-hackers mailing list