Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含以下字段的现金簿表:voucherNo、VoucherType、VoucherDate、Particular、Debit、Credit。
我想根据下图的凭证类型分隔记录。我应该运行什么查询或者我应该使用什么连接来实现这个视图?
SELECT tr.*, tp.* FROM table_data tr LEFT OUTER JOIN table_data tp ON ( tp.VoucherNo# = tr.VoucherNo# AND tp.VoucherType = 'CP' ) WHERE tr.VoucherType = 'CR' ;