# Re: SQL又要如何下??

Posted by JUTSO on January 13, 1999 at 09:22:56:

In Reply to: Re: SQL又要如何下?? posted by jutso on January 13, 1999 at 09:06:17:

: : : 建议你用 sql 先建个表，再交给 crystal 印，不要用 crystal 的 formula ！
: : RE:
: : 我有试过但选不出我所要的，可能功力不够，那用SQL又要如何下才能选出我要的资料呢？范例或关键的SQL指令...期待!!!

: 上面的有点错误，改正如下：

: query1:
: SELECT Last(invoice.date) AS lastdate, invoice.invoiceno
: FROM invoice
: GROUP BY invoice.invoiceno;

: SELECT invoice.*
: FROM invoice LEFT JOIN query1 ON invoice.invoiceno = query1.invoiceno
: WHERE invoice.date=query1.lastdate;

又搞错了！这样才对：
SELECT Last(invoice.date) AS lastdate, invoice.invoiceno, last(debit), last(credit), last(invoice.balance)
FROM invoice
GROUP BY invoice.invoiceno;

Follow Ups:

- *** To JUTSO Someone 15:59:47 1/13/99 (0)
- *** To JUTSO Someone 15:59:36 1/13/99 (0)