I need some help writing a query
Let me first explain what I need to achieve. So we have 3 tables in our database, one that records quotes, another sales and lastly welcome calls. Each of these 3 metrics can occur on a different date or sometimes the same date. I need to somehow query these 3 tables to return the following result. All 3 tables contain the lead_id, date and if quote/sale/welcome calls etc done. Using MySQL
Mysql – Query to display 3 metrics with corresponding date
MySQL
Related Question
- Mysql – How to create a stored procedure with several delete in(select) statements
- MySQL requires FORCE INDEX on huge table and simple SELECTs
- Mysql – Copying to tmp table slow for query … but only sometimes
- Mysql – How to solve intermittent MySQL performance issues on simple queries
- MySQL Performance issue: ~360ms to fetch 120 rows with 10 columns
- Mysql – User variable in nested subquery not getting picked up – in complex sort of 2 tables with gaps
- Mysql – SQl query to create a report based on multiple relational tables
- Mysql – SELECT Dynamic columns with values from other table
Best Answer
Assuming that
(date, lead_id)
is defined as UNIQUE in each table you may use