Help with a tricky/impossible query...

2005-04-14 Thread Paul B van den Berg
Hi, In SQL you need to define the data that you want to work with: create table z ( z int(5) not null primary key); insert into z values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22); If you need more values you could use a simple perl

RE: Help with a tricky/impossible query...

2005-04-14 Thread Andrew Braithwaite
van den Berg [mailto:[EMAIL PROTECTED] Sent: Thu 14 April 2005 10:47 To: MySQL Cc: Andrew Braithwaite Subject: Help with a tricky/impossible query... Hi, In SQL you need to define the data that you want to work with: create table z ( z int(5) not null primary key); insert into z values (1),(2),(3

Re: Help with a tricky/impossible query...

2005-04-14 Thread Paul B van den Berg
On Thu, 14 Apr 2005 11:57:50 +0100 Andrew Braithwaite [EMAIL PROTECTED] wrote: Thanks for the idea, Unfortunately I can't do that as the ranges involved are unknown and will be from 1 to several billion at lease. I can't have another table that needs to be augmented each time my ranges

RE: Help with a tricky/impossible query...

2005-04-14 Thread Gordon
) -Original Message- From: Andrew Braithwaite [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 7:33 PM To: MySQL Subject: Re: Help with a tricky/impossible query... I should mention that I'm constrained to version 4.0.n so no sub queries for me! Andrew On 14/4/05 1:11 am, Andrew

Help with a tricky/impossible query...

2005-04-13 Thread Andrew Braithwaite
Hi, I need some help with a tricky query. Before anyone asks, I cannot bring this functionality back to the application layer (as much as I'd like to). Here's what I need to do... create table wibble( seq int(3) auto_increment primary key, x int(5), y int(5) ); insert into wibble set x=5,

Re: Help with a tricky/impossible query...

2005-04-13 Thread Andrew Braithwaite
I should mention that I'm constrained to version 4.0.n so no sub queries for me! Andrew On 14/4/05 1:11 am, Andrew Braithwaite [EMAIL PROTECTED] wrote: Hi, I need some help with a tricky query. Before anyone asks, I cannot bring this functionality back to the application layer (as much

RE: Impossible query??

2003-06-15 Thread Michael Scott
PROTECTED] Sent: Saturday, June 14, 2003 4:13 PM To: [EMAIL PROTECTED] Subject: Re: Impossible query?? Your query seems relatively easy if you don't need the first test (in this case, testID 2) explicitly printed. mysql SELECT * FROM tests WHERE testID=7 AND connect0

Impossible query??

2003-06-14 Thread trashMan
Hi, sorry for my bad english. I've a table where i store the result of a quality test. If the test is passed then the result=ok and connect=0 If test fail then result=nok and, if it's the first test for the product, connect=0 When i retest a failed product i've connect= previous testid of the

Re: Impossible query??

2003-06-14 Thread Becoming Digital
] To: [EMAIL PROTECTED] Sent: Saturday, 14 June, 2003 11:28 Subject: Impossible query?? Hi, sorry for my bad english. I've a table where i store the result of a quality test. If the test is passed then the result=ok and connect=0 If test fail then result=nok and, if it's the first test for the product

Impossible Query?

2002-07-11 Thread Daren Cotter
I have three tables, affiliates, clients, and sales. The affiliates table stores all of the information about affiliates, clients about clients, sales about sales. In the clients table, there is a field for affiliate_id (affiliates refer clients), and in the sales table there is a field for

Impossible Query?

2002-07-11 Thread Daren Cotter
I have three tables, affiliates, clients, and sales. The affiliates table stores all of the information about affiliates, clients about clients, sales about sales. In the clients table, there is a field for affiliate_id (affiliates refer clients), and in the sales table there is a field for

RE: Impossible Query?

2002-07-11 Thread Witness
Cotter [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 5:03 PM To: [EMAIL PROTECTED] Subject: Impossible Query? I have three tables, affiliates, clients, and sales. The affiliates table stores all of the information about affiliates, clients about clients, sales about sales

RE: Impossible Query?

2002-07-11 Thread Keith C. Ivey
On 11 Jul 2002, at 17:41, Witness wrote: SELECT DISTINCT affiliates.id, DISTINCT sales.client_id,SUM(sales.client_id) FROM affiliates,clients,sales WHERE affiliates.id = clients.affiliate_id AND sales.client_id = clients.id; I don't think that's what Daren wanted. For one thing, I

strange or impossible query?

2002-06-07 Thread Fabrizio Tivano
Hello dear all, i have a table like this: field_machine, field_date, field_time, field_function. field_function can be =TT or +BT well i need to perform a select query, witch display on one line field_machine, (field_date, field_time where field_function =TT) AS start, (field_date,

Re: strange or impossible query?

2002-06-07 Thread Rob
I'm afraid I'm not quite clear on what you're trying to do; do you want one result per row, with one NULL column and one non-NULL column, or do you want one row per distinct 'machine', with both a start and a stop date? In the first case, this can be implemented with a simple IF():