Garg Garg - 3 months ago 8
MySQL Question

Select from three tables without where or on clauses

I have three tables from which I want to show some information. Problem is that one of them

ps_mycase_output_design
isn't connect by anything with others.
All I want is just to be able to show information from all of them. I don't need to query by ID's ,.. or WHERE clauses etc. This is from where I started but I've got

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY mycase.key_product_output DESC LIMIT 10' at line 13


Here is the simple query

SELECT customer.*, mycase.*, orders.*

FROM
ps_customer customer
LEFT JOIN
ps_orders orders
LEFT JOIN
ps_mycase_output_design mycase
ORDER BY mycase.key_product_output DESC LIMIT 10

Answer

If you don't want to use ON or WHERE clause, try this:

SELECT customer.*, mycase.*, orders.*
FROM
    ps_customer customer,ps_orders orders,ps_mycase_output_design mycase 
ORDER BY mycase.key_product_output DESC LIMIT 10

Not sure this is what you need logically.

Comments