Need help with a SQL query

From: Anders Windelhed <anders_at_underlandstudios.com>
Date: Wed, 26 Mar 2003 23:41:50 +0100
Message-ID: <txqga.30193$oe.93724_at_amstwist00>


[Quoted] I need help with a SQL query...

I have three queries:

[Quoted] (select 'a' as ATTRIBUT , count(*) as no from table1 where a is not null)

[Quoted] (select 'b' as ATTRIBUT, count(*) as no from table1 where b is not null)

[Quoted] (select 'c' as ATTRIBUT, count(*) as no from table1 where c is not null)

[Quoted] the results from these queries looks like this

attribut no
a 34

and so on...

I would like to combine into one result table like this

attribut no

a           34
b          334
c           23

I know that it would be much easier to create a query that gives the result like this

a b c
[Quoted] 34 334 23

[Quoted] but that won't solve my problem =(

[Quoted] Any suggestions?

Best regards

Anders Received on Wed Mar 26 2003 - 23:41:50 CET

Original text of this message