mysql - How to fetch two records from subquery -


i want fetch 2 records subquery gives error below u tried

below works :

select id, (select color tblcolor pid=id) color form maintable 

not works

select id, (select color,price tblcolor pid=id) form maintable 

please me solution it

from question, seems you're looking for:

select t1.id, t2.color, t2.price maintable t1 inner join tblcolor t2 on t1.id = t2.pid 

Comments

Popular posts from this blog

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -