I have a settings table built with a "category" that defines different products, "memory_name" is the name of the variable, and "information" is the value of the parameter.
for example,
select top 6 category, varname, info
from settings_table
where NODE_NAME='HTT-COMM-A'
and section='Module Settings'
and category in ('ProductA', 'ProductB')
order by varname
leads to:
category varname info
ProductB WEB_ACCESS_ALLOW NO
ProductA WEB_ACCESS_ALLOW NO
ProductB WEB_ACCESS_BLOCK YES
ProductA WEB_ACCESS_BLOCK YES
ProductB WEB_ACCOUNT_DETAIL NO
ProductA WEB_ACCOUNT_DETAIL YES
I would like to create a simple list of differences between the values when category = 'ProductA' and 'ProductB'. I can come up with several ways to do this using a temporary table or several subqueries (for example, this is painful):
select a.category, a.varname, a.info , b.category, b.info
from (select category, varname, info, description
from settings_table
where category = 'ProductA') as a,
(select category, varname,info, description
from settings_table
where category = 'ProductB') as b
where a.varname=b.varname and a.info != b.info
( ) , b var, a. ( , a b .)
, , " " , .
SQL, MSSQL.
,
Rk