🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
5 messages
5 total messages Started by Toni Van Remortel Fri, 04 Oct 2002 10:02
SELECT MAX(processor_id) AS p_id FROM * ??? Andere oplossing?
#7357
Author: Toni Van Remortel
Date: Fri, 04 Oct 2002 10:02
10 lines
1450 bytes
Is er een mogelijkheid om met 1 MySQL lijntje, de maximum waarde te bepalen 
van een veld dat in meerdere tabellen voorkomt?
Maw: het veld 'processor_id' staat in +/- de helft van de tabellen, en ik 
wens de grootste waarde ervan te kennen over gans de database.

SELECT MAX(processor_id) AS p_id FROM *;
is helaas niet toegestaan :-(
-- 
$Toni->Groeten();
$Toni->SetQuote("$ man woman \n No manual entry for woman");
Re: SELECT MAX(processor_id) AS p_id FROM * ??? Andere oplossing?
#7358
Author: Wim Godden
Date: Fri, 04 Oct 2002 11:12
28 lines
1916 bytes
Misschien :
SELECT GREATEST(MAX(tabel1.processor_id),MAX(tabel2.processor_id)) AS p_id FROM
tabel1, tabel2;

Give it a try and let me know !

--
------
Colocation/housing kosten te hoog --> http://www.housingcenter.be
--
Adverteren.be - 100% Nederlandstalig adverteren op kwalitatief hoogstaande
sites !




Toni Van Remortel wrote:

> Is er een mogelijkheid om met 1 MySQL lijntje, de maximum waarde te bepalen
> van een veld dat in meerdere tabellen voorkomt?
> Maw: het veld 'processor_id' staat in +/- de helft van de tabellen, en ik
> wens de grootste waarde ervan te kennen over gans de database.
>
> SELECT MAX(processor_id) AS p_id FROM *;
> is helaas niet toegestaan :-(
> --
> $Toni->Groeten();
> $Toni->SetQuote("$ man woman \n No manual entry for woman");
Re: SELECT MAX(processor_id) AS p_id FROM * ??? Andere oplossing?
#7359
Author: Toni Van Remortel
Date: Fri, 04 Oct 2002 12:06
14 lines
1544 bytes
Wim Godden wrote:

> Misschien :
> SELECT GREATEST(MAX(tabel1.processor_id),MAX(tabel2.processor_id)) AS p_id
> FROM tabel1, tabel2;
> 
> Give it a try and let me know !

Dat lijkt wel te lukken. Maar ik moet wel alle tabellen zelf invoeren :-(
Even lmij 30 min brainlass bezighouden met copy-n-paste.

-- 
$Toni->Groeten();
$Toni->SetQuote("$ man woman \n No manual entry for woman");
Re: SELECT MAX(processor_id) AS p_id FROM * ??? Andere oplossing?
#7360
Author: Toni Van Remortel
Date: Fri, 04 Oct 2002 12:24
19 lines
1868 bytes
Toni Van Remortel wrote:

> Wim Godden wrote:
> 
>> Misschien :
>> SELECT GREATEST(MAX(tabel1.processor_id),MAX(tabel2.processor_id)) AS
>> p_id FROM tabel1, tabel2;
>> 
>> Give it a try and let me know !
> 
> Dat lijkt wel te lukken. Maar ik moet wel alle tabellen zelf invoeren :-(
> Even lmij 30 min brainlass bezighouden met copy-n-paste.

Blijkbaar toch sneller gegaan dan ik dacht. Maar MySQl loopt er op vast :(
Met 2 tabellen ging het vanzelf, maar met alle tabellen loopt ie vast.

-- 
$Toni->Groeten();
$Toni->SetQuote("$ man woman \n No manual entry for woman");
Re: SELECT MAX(processor_id) AS p_id FROM * ??? Andere oplossing?
#7361
Author: Toni Van Remortel
Date: Fri, 04 Oct 2002 12:30
23 lines
1912 bytes
Toni Van Remortel wrote:

> Toni Van Remortel wrote:
> 
>> Wim Godden wrote:
>> 
>>> Misschien :
>>> SELECT GREATEST(MAX(tabel1.processor_id),MAX(tabel2.processor_id)) AS
>>> p_id FROM tabel1, tabel2;
>>> 
>>> Give it a try and let me know !
>> 
>> Dat lijkt wel te lukken. Maar ik moet wel alle tabellen zelf invoeren :-(
>> Even lmij 30 min brainlass bezighouden met copy-n-paste.
> 
> Blijkbaar toch sneller gegaan dan ik dacht. Maar MySQl loopt er op vast :(
> Met 2 tabellen ging het vanzelf, maar met alle tabellen loopt ie vast.

Dan maar multiple queries. Dat doet ie wel.

-- 
$Toni->Groeten();
$Toni->SetQuote("$ man woman \n No manual entry for woman");
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads