Today, I have to write a query statement, I wrote it for a long time, and finally, I finally used group by with the help of my colleagues. It is actually quite simple, but I use too little to use the database, huh, huh; (item table good, field is GID (item ID), Price (item price), and TID (the transaction ID) trading table Trade, field is TID (Transaction ID), Date (trading time) needs to write a query statement, list all the fields of transactions, then follow the total list of transactions, such as: Tid Date Total1 11-24-2004 10.102 11-23-2004 100.50 Query statement is as follows : Select trade.tid, trade.date, sum.price.com trade, goodwhere trade.tid = good.tidgroup by trade.tid, trade.date Note: Trade. *, As for why, I haven't want to know it yet ^ _ ^