我有两个 mysql 表 tblSharesRegistry、tblSharesAccount。我想加入两个表并按日期显示行。但它显示数据不正确。请提供任何帮助。
1. tblSharesRegistry
ID EMPNumber NoOfShares Amount Deposit Date
1 1111 100 10000 1 2012-07-20
2 1234 50 5000 1 2012-08-12
3 1001 10 1000 1 2012-09-25
4 1001 10 1000 1 2012-10-25
5 1001 10 1000 1 2012-11-25
6 1001 -5 -500 0 2012-11-28
2. tblSharesAccount
ID EMPNumber Balance Interest Rate Date
1 1111 10000 1000 10 2012-11-29
2 1234 5000 500 10 2012-11-29
3 1001 2500 250 10 2012-11-29
并且输出应该是 EMPNumber: 1001
Date Description #Shares Amount Interest Total
2012-09-25 Shares bought 10 1000 - 1000
2012-10-25 Shares bought 10 1000 - 2000
2012-11-25 Shares bought 10 1000 - 3000
2012-11-28 Shares sold -5 -500 - 2500
2012-01-29 Interest 25 2500 250 2750
我当前用于连接两个表的代码
SELECT tblSharesRegistry.Date, tblSharesRegistry.NoOfShares, tblSharesRegistry.Amount, tblSharesAccount.Interest, tblSharesAccount.Date FROM tblSharesAccount INNER JOIN tblSharesRegistry ON tblSharesAccount.EMPNumber = tblSharesRegistry.EMPNumber WHERE tblSharesRegistry.EMPNumber = '1001' ORDER BY Date DESC
VB.NET 错误: