Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1821

Re: compare two rows

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: compare two rows
Date 2014-10-26 10:49 +0100
Organization Erland Sommarskog
Message-ID <XnsA3D26E1D9869BYazorman@127.0.0.1> (permalink)
References <m2i7bf$9aq$1@node2.news.atman.pl>

Show all headers | View raw


seb (gekonik@poczta.fm) writes:
> i have 2 rows ,who have the same value but in other columnes how to 
> check diffrence betwwen them
> 
> example:
> 
> 2,'something',something2,null,6
> 3,'something5',something8,6,7
> 
> the same value is 6 how to check in wchich columnes is diffrent bettwen 
> them?
> 

I'm not sure that this makes any sense to me. Two rows, the value 6 appears
in both, but in different columns? And?

A table is supposed to model a unique entity and each column is supposed
to model a unique attribute of that entity. So if on one row, the column 
apple has the value 6, and on another row the column orange has the value
6, you would still be comparing apples and oranges.

So maybe your real problem is that your database design is not the best one.

But apart from that, I don't really understand "wchich columnes is diffrent 
bettwen them?". In the example above, what output do you want?


-- 
Erland Sommarskog, Stockholm, esquel@sommarskog.se

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

compare two rows seb <gekonik@poczta.fm> - 2014-10-26 08:20 +0100
  Re: compare two rows Erland Sommarskog <esquel@sommarskog.se> - 2014-10-26 10:49 +0100

csiph-web