473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

altering data

Hello!

I have a problem that I really could use some help to solve. I have a table
which looks like this:

id1, id2, id3, rate, ratenr

Examples of a select * from this table would be:

1047336399 21000 1 617 1
1047336399 21000 1 624B 1
1047336399 21000 1 621D 1
1047336399 21000 2 624B 1
1047336399 21000 2 612A 1
1047336399 21000 2 621D 1
1047336399 21000 3 617 1
1047336399 21000 3 624B 1
1047336399 21000 3 621D 1

I would like to transform this table into something like this:

1047336399 21000 1 617 1 624B 1 621D 1
1047336399 21000 2 624B 1 612A 1 621D 1
1047336399 21000 3 617 1 624B 1 621D 1
the three first columns should be the primary key.

Any help is appreciated

Gunnar

Jul 20 '05 #1
1 1182
> I would like to transform this table into something like this:

1047336399 21000 1 617 1 624B 1 621D 1
1047336399 21000 2 624B 1 612A 1 621D 1
1047336399 21000 3 617 1 624B 1 621D 1


This is not a normalised result set. You shouldn't create a table like this
in your database because the rate columns are a repeating group (violation
of 1st Normal Form). Your initial table appears to be a normalised design.

If this is supposed to be crosstab report then do it in your application or
report generator. Or Google search this group for "crosstab" to find lots of
examples.

--
David Portas
------------
Please reply only to the newsgroup
--
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: J.Beaulieu | last post by:
Hi suppose that I have a set named 'my_set' wich contain 'aaa','bbb','ccc' and I want to alter with an sql command the structure to get 'ddd' in addition. How can I do that?
4
by: fake | last post by:
What exactly does the line: rGfxOptionsWnd* m_pGfxOptionsWnd; do? I have chased this bug and narrowed it down to something that I believe should not happen and I don't even know what could...
0
by: Michael Ekstrand | last post by:
In the course of my current project, I've had to deal with connecting to an HTTP server that isn't fully compliant with the HTTP requirements for chunked encodings. Rather than sending the...
3
by: Scott | last post by:
I am trying to alter the ForeColor of a TextBox object so that parts of the displayed text are written in various colors. For example, when writing to the TextBox I wish to display parts of the...
12
by: Bernie Yaeger | last post by:
My client has a visual foxpro app that he wants me to hook into. I'm connecting to it via odbc with this connectionstring: Dim oconn_d As New OdbcConnection("Driver={Microsoft Visual FoxPro...
12
by: Prabu Subroto | last post by:
Dear my friends... I am using postgres 7.4 and SuSE 9.1. I want to use auto_increment as on MySQL. I look up the documentation on www.postgres.com and I found "serial" . But I don't know...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
1
by: zufie | last post by:
Hi, I want to specifying a foreign key by altering a table. First, I create an ORDERS table without specifying a foreign key. Here is my code: CREATE TABLE ORDERS (Order_ID integer,...
3
by: nexus024 | last post by:
I am trying to write a program that will continuously sniff eth0 for a specific UDP packet thats being sent to a specific destination IP, alter the data of the packet, and finally transmit it to the...
1
by: RGow | last post by:
Hi, I'd like to know whether there is a way to alter the data type of a VARCHAR FOR BIT DATA column to be simply a VARCHAR column? I executed an ALTER TABLE statement, similar to, ALTER TABLE...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.