Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

[SOLVED] Join two tables
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: [SOLVED] Join two tables
#35133
[SOLVED] Join two tables 11 Years, 6 Months ago Karma: 1
Hello

Could you help me how to write mysql query to join two tables?

Currently I have this query:

SELECT actor, title, content, created FROM #_community_activities WHERE created > "2012-12-13 12:00:00" AND (app != "com_easyblog") LIMIT 1000

"actor" field shows Joomla user ID, so it's the same like "id" field in "#_users" table

I would like to join "username" field from Joomla "#_users" table into my query, so that ARI output shows this:

username actor title content created

Regards
Krx
User Offline Click here to see the profile of this user
Last Edit: 2012/12/22 12:06 By Krx.
The administrator has disabled public write access.
 
#35135
Re:Join two tables 11 Years, 6 Months ago Karma: 748
Hello,

Use the following query:


SELECT
U.username,
A.actor,
A.title,
A.content,
A.created
FROM
#__community_activities A INNER JOIN #__users U
ON A.actor = U.id
WHERE
A.created > "2012-12-13 12:00:00"
AND
A.app != "com_easyblog"
LIMIT 1000


Regards,
ARI Soft
The administrator has disabled public write access.
 
#35136
Re:Join two tables 11 Years, 6 Months ago Karma: 1
Hi

Thanks, it works
I'll use this example to re-modify all my other ARI queries.

Regards
Krx
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#37883
Re:Join two tables 11 Years, 4 Months ago Karma: 0
I've tried the above but U.name doesn't appear in the resulting table (all the others do)
user_id is the same as the user table id - any ideas why?

SELECT
U.name,
A.course_id,
A.lpath_id,
A.user_id,
A.user_status,
A.start_time
FROM
#__lms_learn_path_results A INNER JOIN #__users U
ON A.user_id = U.id
yws
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#37894
Re:Join two tables 11 Years, 4 Months ago Karma: 748
Hello,

Could you provide a link to a page where we can see the problem and a temporary access to your J! backend by email so we can investigate it?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#37918
Re:Join two tables 11 Years, 4 Months ago Karma: 748
Try now. The column was hidden because "Columns settings -> Hidden" parameter was set to "Yes" for the first column.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 12