MySQL noob with a table-joining question:
I have two tables, "splits" and "dividends" that describe events in the stock market.
The splits table has "day", "ratio", and "ticker". The dividends table has "day", "amount", and "ticker".
I would like to get a resulting joined table that has both tables' information, AND sorted by date and ticker. So something like this: (sorry about the formatting)
splits.day splits.ratio splits.ticker dividends.day dividends.amount dividends.ticker
1990-01-03 2 QQQQ null null null
null null null 1995-05-05 15.55 SPY
2000-09-15 3 DIA null null null
null null null 2005-03-15 3 DIA
I looked up full outer joins on wikipedia (using unions on mysql) but I couldn't figure out how to get it to be sorted by the day... Any help would be greatly appreciated!
EDIT: here's an example of what splits and dividends contain in the above example
splits.day splits.ratio splits.ticker
1990-01-03 2 QQQQ
2000-09-15 3 DIA
dividends.day dividends.amount dividends.ticker
1995-05-05 15.55 SPY
2005-03-15 3.55 QQQQ