I received a requirement today to write a SQL View for a smartlist that would show tax detail history and the line items. We wanted to use TX30000 for the base table so that we'd be sure that we weren't missing any lines. But TX30000 has one line for each tax detail in the order and we really wanted one line for the order, so in the view you'll see that the first line in the where clause is a sub query that returns one line for the order.
Then we join in the SOP30300 for the item info and the SOP10105 tax table for tax detail info, per the customer's request.
I always put a select statement below the 'create view' statement to be able to easily test the code.