Re: SQL statement for multiple classes

2021-03-12 Thread Skylar Thompson
odename1 1123123131223 > > Thanks for your help! > > Kind regards, > Eric van Loon > Air France/KLM Storage & Backup > > -Original Message- > From: ADSM: Dist Stor Manager On Behalf Of Skylar > Thompson > Sent: vrijdag 12 maart 2021 16:49 > To

Re: SQL statement for multiple classes

2021-03-12 Thread Loon, Eric van (ITOP NS) - KLM
SQL statement for multiple classes Hi Eric, I was actually trying to something similar with different data and tables a few weeks ago. With the help of a co-worker, we figured it out. It has to be a 2 step process. First you get a list of all the values you want as the column headings, in

Re: SQL statement for multiple classes

2021-03-12 Thread Loon, Eric van (ITOP NS) - KLM
U Subject: Re: SQL statement for multiple classes Hi Eric, You can part of the way there with GROUP BY: SELECT node_name,class_name,COUNT(*) FROM archives GROUP BY node_name,class_name This will give you one row per (node_name,class_name) tuple. In order to get row values as columns, though, you n

Re: SQL statement for multiple classes

2021-03-12 Thread Marc Lanteigne
Hi Eric, I was actually trying to something similar with different data and tables a few weeks ago. With the help of a co-worker, we figured it out. It has to be a 2 step process. First you get a list of all the values you want as the column headings, in your case, the class name: select distinc

Re: SQL statement for multiple classes

2021-03-12 Thread Skylar Thompson
Hi Eric, You can part of the way there with GROUP BY: SELECT node_name,class_name,COUNT(*) FROM archives GROUP BY node_name,class_name This will give you one row per (node_name,class_name) tuple. In order to get row values as columns, though, you need to do a pivot (aka crosstab), which I'm not