473,379 Members | 1,533 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,379 software developers and data experts.

Select Column in Sequence

I have a situation where a person can have more then one item ordered. I need to layout the information as follows:

Person Items Ordered Item Description
----------------------------------------------------------------
1 1 of 2 Item1
1 2 of 2 Item2
2 1 of 1 Item1
3 1 of 3 Item3
3 2 of 3 Item1
3 3 of 3 Item2
.


The information is in the same table and the Items Ordered is in relationship to the Person and not the Item Description.

If anyone could help me it would be appreciated

ponderena
Jul 25 '07 #1
8 1917
I have a situation where a person can have more then one item ordered. I need to layout the information as follows:

The first column, Person has:
1
1
2
3
3
3

The second column, Items Ordered has:

1 of 2
2 of 2
1 of 1
1 of 3
2 of 3
3 of 3

The third column, Item Description has:

Item1
Item2
Item1
Item3
Item1
Item2

.

I need to keep count of the the number of orders a person has and the tricky part for me is the ' num of <total number of orders>' column.

The information is in the same table and the Items Ordered is in relationship to the Person and not the Item Description.

If anyone could help me it would be appreciated

ponderena
Jul 25 '07 #2
debasisdas
8,127 Expert 4TB
Can you please specify what exactly you want to achieve .

post with all your table structures and relations there off.
Jul 25 '07 #3
Could you please look at the post above Select Sequence it may be clearer of what I am trying to achieve.

ponderena
Jul 25 '07 #4
The name of the post is 'Select Column In Sequence'.

ponderena
Jul 25 '07 #5
debasisdas
8,127 Expert 4TB
Kindly do not double post your questions .

Patiently wait for experts to answer your question.
Jul 25 '07 #6
debasisdas
8,127 Expert 4TB
Post your questions clearly and specify what exactly you want to achieve .

post with all your table structures and relations there off.
Jul 25 '07 #7
The first post was not readable. So I posted another. I know now that I should have replied to the first with a revised version of my question.

ponderena
Jul 25 '07 #8
debasisdas
8,127 Expert 4TB
Both the threads are merged for convenience

MODERATOR.
Jul 25 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: John Fabiani | last post by:
Hi, I'm a newbie and I'm attempting to learn howto create a select statement. When I use >>> string1='18 Tadlock Place' >>> cursor.execute("SELECT * FROM mytest where address = %s",string1) All...
5
by: Ken1 | last post by:
I am going to drop a primary key from one column and create a new column to be used as primary key in an existing database. The old column was a date column which someone earlier though was a good...
12
by: Andrew Baker | last post by:
What is the best way to lock an individual row in the following scenerio: --TODO - LOCK THIS ROW -- Return the next id SELECT next_id INTO next_id_out FROM owner.my_id_table WHERE app_id =...
7
by: php newbie | last post by:
I am trying to copy data from one table to another, and in the process add a sequence number to copied rows. I have looked at the IDENTITY function when creating tables, and essentially this is...
6
by: python1 | last post by:
I apologize if this is redundant. How would one fill an empty column with a sequence of numbers? The column exists in a table with aproximately 1000000 rows of data. I believe in oracle the...
1
by: php newbie | last post by:
I have the following query that has been working so far. I modified it slightly to work from another source table (new_products). Now, SQL Server complains that the identity is inherited already:...
1
by: Gaz | last post by:
I'm sure this is an obvious question but much of SQL is new to me. I have a stored procedure and I want to use the results of a select statement elsewhere in the stored prcedure. The select...
3
by: Alex | last post by:
Hi, I need to form a query where i can add some columns based on the result. Table A ColA, ColB ---------- 1 A 2 B
6
by: Bjørn T Johansen | last post by:
I need to maintain a manually counter for an id-field, but I can do this two ways. Either make a counter table (which means one select and one update) or just selecting the largest id from existing...
3
by: D. Dante Lorenso | last post by:
I just ran into a dump/restore problem with a bigserial column on a renamed table. BIGSERIAL columns when created will automagically create the sequence also. The sequence name is derived from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.