Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MODIFYING TABLE PROBLEM

Status
Not open for further replies.

aas1611

Programmer
Dec 14, 2001
184
0
0
DE
Hi,
I don't know if this forum is the right one, however, I wonder if someone could help me. I need to modify a table,

for example, from: Name Number
----- ------
AAA 123
AAA 456
AAA 789

into: Name Number
---- ------
AAA 123
456
789

got the idea?

Is there a way to do that in stored procedures? any SQL language?

Thanks Much!!!
 
It is kind of strange that you want a field as "Blank". However, you may try:

Update T Set Name = ''
From TableName T
Join
(Select Name, minNumber = Min(Number) from TableName Group By Name) as T1
on T.Name = T1.Name
Where T.Number > T1.minNumber
 
I recommend that you consider the impact of spacing out the data in a table. You will lose all data integrity and selectivity. I suspect, though I may be wrong, that you have a reporting requirement and want to display the data in a certain format with blanks for duplicate fields. MS Access provides an excellent report generation capability which can do just what that without destroying the data. Terry L. Broadbent - Salt Lake City, UT
Home of the 2002 Winter Olympics (Feb 8-24)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top