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

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

laravel - Undefined property: Illuminate\Pagination\LengthAwarePaginator::$id (View: F:\project\resources\views\admin\carousels\index.blade.php) -