0
I want to conduct a consultation SQL and change the name of the columns in the result because I have 3 columns id
.
Currently my SQL this way:
SELECT *
FROM shopweb_tipo as st
INNER JOIN shopweb_categoria AS sc
INNER JOIN shopweb AS s
WHERE s.categoria = sc.id
AND s.tipo = st.id
I tried to do so but I could not result.
SELECT *
FROM shopweb_tipo as st
INNER JOIN shopweb_categoria AS sc
INNER JOIN shopweb AS s
WHERE s.categoria = sc.id
AND s.tipo = st.id
AND shopweb.id as "id_shopweb"
But it would not be very feasible, imagine each table containing 9 to 15 fields and add up an average of 40 fields, it would be a huge query.
– Everton Figueiredo
you can repeat the field ID? because then could do otherwise, already edit the answer
– arllondias
only the ID fields yes, why I need each separate id and when I pull with php I don’t know which one I’m picking up.
– Everton Figueiredo
So with the second example, it solves your problem
– arllondias
Yes solved, was exactly what I needed, no problem for me id repeat since in the application I specify.
– Everton Figueiredo
All right, if you can accept my answer, I’d appreciate it ;)
– arllondias
Waiting for the time to accept.
– Everton Figueiredo