Re: Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread Brad Stiles
> SELECT TotalInvoice, (SELECT SUM(PaymentValue) FROM Payments > WHERE Payments.IDInvoice = IDInvoice) AS TotalPaid, TotalPaid = TotalInvoice > AS FullyPaid FROM Invoices; > > Here, I select: > - TotalInvoice the total amount of the invoice > - TotalPaid the total amount paid till now > - FullyP

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread Jay Sprenkle
On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, and thanks for the reply. SELECT * from Employees where IDContractLevel > 4 is not enough, since I actually need to use a field that is created inside the SQL statement to create another field. The problem is that it seems that t

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread elemaco71-sqlite
Hello, and thanks for the reply. SELECT * from Employees where IDContractLevel > 4 is not enough, since I actually need to use a field that is created inside the SQL statement to create another field. The problem is that it seems that the computed fields is not existing yet when it is used for

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread Jay Sprenkle
On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, everybody I'm using a SQL clause to get data from the DB, and I need to use "computed" fields to get the value of other fields. A (stupid) example of what I need is this: SELECT IDContractLevel, IDContractLevel > 4 as IAmBoss, (

[sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread elemaco71-sqlite
Hello, everybody I'm using a SQL clause to get data from the DB, and I need to use "computed" fields to get the value of other fields. A (stupid) example of what I need is this: SELECT IDContractLevel, IDContractLevel > 4 as IAmBoss, (SELECT * FROM Bosses WHERE Flag = IAmBoss) FROM Employees