Question

I got mySQL query like this:

SELECT * 
FROM products_description pd 
LEFT JOIN products zp 
   ON pd.products_id = zp.products_id 
LIMIT 0 , 1000

This simply joins two tables together, and outputs columns and rows based on the same product id. Now I need only to narrow the columns to two, column_a AND column_b

How do I go about it?

@EDIT When two tables are joined am unable to get primary key in order to edit the table. How do I go around it to have primary key (unique) and make the table editable when joined.

Was it helpful?

Solution

Try this, SELECT pd.column_a, pd.column_b

SELECT pd.column_a, pd.column_b
FROM products_description pd 
LEFT JOIN products zp 
   ON pd.products_id = zp.products_id 
LIMIT 0 , 1000

OTHER TIPS

SELECT column_a, column_b
FROM products_description pd 
LEFT JOIN products zp 
   ON pd.products_id = zp.products_id 
LIMIT 0 , 1000

you need just to select those two columns

  SELECT column_a , column_b
  FROM products_description pd 
  LEFT JOIN products zp 
  ON pd.products_id = zp.products_id 
  LIMIT 0 , 1000
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top