Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure what is wrong with innerJoin #31

Open
Niloys7 opened this issue Sep 9, 2023 · 0 comments
Open

Not sure what is wrong with innerJoin #31

Niloys7 opened this issue Sep 9, 2023 · 0 comments

Comments

@Niloys7
Copy link

Niloys7 commented Sep 9, 2023

Hi, I am using this wonderful library for our client's project. However, I am unable to retrieve data from this innerJoin query.

I seem to be having some trouble here 😕. Perhaps I overlooked something. If anyone could offer a solution, I would greatly appreciate it. 🙏

$result = $db::select( 'bv_sku_key_map.sku_child' )
	->from( 'bv_sku_key_map' )
	->innerJoin( 'bv_sku_child','bv_sku_key_map.sku_key','bv_sku_child.main_sku')
	->Where('bv_sku_child.child_sku', '=','G 10078')
	->get();

Here is the original SQL query, and it is working.

SELECT DISTINCT
	wp_bv_sku_key_map.sku_child
	
FROM
	wp_bv_sku_key_map
	INNER JOIN wp_bv_sku_child ON wp_bv_sku_key_map.sku_key = wp_bv_sku_child.main_sku
WHERE
	wp_bv_sku_child.child_sku = 'G 10078';

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant