how to create a field in a view that is unique - 11-30-2011 , 11:10 AM
I've got a view, pulling fields from many tables
but no one table's key is being used, so I have no unique field
is there a function in sql server that will do this ?
select a.cust, b.price, x
from tblCust as a inner join tblCustPrice on a.cust = b.cust
how to make 'x' be 1,2,3, etc
Re: how to create a field in a view that is unique - 11-30-2011 , 12:42 PM
Re: how to create a field in a view that is unique - 11-30-2011 , 06:05 PM
On Nov 30, 11:42*am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Re: how to create a field in a view that is unique - 12-05-2011 , 04:22 PM
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Please learn to follow ISO-11179 data element naming
conventions and formatting rules. Temporal data should use ISO-8601
formats. Code should be in Standard SQL as much as possible and not
Sample data is also a good idea, along with clear specifications. It
is very hard to debug code when you do not let us see it. If you want
to learn how to ask a question on a Newsgroup, look at:
http://www.catb.org/~esr/faqs/smart-questions.html I have following
tables and business rules.
attribute does this magic number model? Guess at usable data element
names, how does this work for you?
SELECT C1.cust_nbr, C2.something_price,
OVER (ORDER BY C1.cust_nbr, C2.something_price)
FROM Customers AS C1,
Customers AS C2
WHERE C1.cust_nbr = C2.cust_nbr;
OYour VIEW can now be used as a non-relational magnetic tape file,
which do have fields and not columns. Your whole approach is wrong;
please read a book on basic RDBMS.