Skip to content

JOIN => Add USING statement #11

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abbadon1334
Copy link
Contributor

In PHP 7.1.15 if you do something like :
SQL :
SELECT
tbl_a.col_a, tbl_a.col_b,
tbl_b.col_ba, tbl_b.col_bb
FROM tbl_a
LEFT JOIN tbl_b ON (tbl_a.ID = tbl_b.ID)

results will be nulled for all tbl_b columns

with USING this problem is solved.

it works but i don't like my conditional : strpos(array_values($val)[0],'.')

if i want a table alias, because i put it in the conf, i need to get it in my query
In PHP 7.1.15 if you do something like :
SQL : 
SELECT
tbl_a.col_a, tbl_a.col_b,
tbl_b.col_ba, tbl_b.col_bb
FROM tbl_a
LEFT JOIN tbl_b ON (tbl_a.ID = tbl_b.ID)

results will be nulled for all tbl_b columns

with USING this problem is solved.

it works but i don't like my conditional : strpos(array_values($val)[0],'.')
@Andrews54757
Copy link
Collaborator

@abbadon1334 I will investigate the USING statement.

However, the PHP count and strpos functions are very slow. I try to not use them entirely, as inserting only a couple slows things dramatically. I will try to find alternative ways to do this.

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

Successfully merging this pull request may close these issues.

2 participants