Home » SQL & PL/SQL » SQL & PL/SQL » SQL query required (Merged)
SQL query required (Merged) [message #184985] Sat, 29 July 2006 09:58 Go to next message
sheharyararshad
Messages: 10
Registered: May 2006
Location: KUWAIT
Junior Member

Hello every one
Plz help me out in making a query
I have 2 fileds in a table filed1 contains values from a-z and field 2 contains values from 1-100.

Field1 filed2
A 1
B 2
C 3
. .
. .
. .
Z 100

I want the result to be shown in this way

Field1 filed2
A 1
A 2
A 3
A .
A .
A .
A 100
B 1
B 2
B 3
B .
B .
B .
B .
B 100
. .
. .
. .
. .
. .
. .
. .
Z 1
Z 2
Z 3
Z .
Z .
Z 100

but plz note the actual values which i have in field 2 is not in the same sequence like 123.....100. it would be any random numbers. plz can any one make a simple query for this.
take care bye
Re: urgently required query [message #184990 is a reply to message #184985] Sat, 29 July 2006 11:10 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
With advice, you can have good, fast, or free. Pick any two.
Here is a free clue, use ORDER BY
sql query required [message #184992 is a reply to message #184985] Sat, 29 July 2006 11:17 Go to previous messageGo to next message
sheharyararshad
Messages: 10
Registered: May 2006
Location: KUWAIT
Junior Member

Hello every one
Plz help me out in making a query
I have 2 fileds in a table filed1 contains values from a-z and field 2 contains values from 1-100.

Field1 filed2
A 1
B 2
C 3
. .
. .
. .
Z 100

I want the result to be shown in this way

Field1 filed2
A 1
A 2
A 3
A .
A .
A .
A 100
B 1
B 2
B 3
B .
B .
B .
B .
B 100
. .
. .
. .
. .
. .
. .
. .
Z 1
Z 2
Z 3
Z .
Z .
Z 100

but plz note the actual values which i have in field 2 is not in the same sequence like 123.....100. it would be any random numbers. plz can any one make a simple query for this.
take care bye
Re: sql query required [message #184994 is a reply to message #184992] Sat, 29 July 2006 11:20 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Do NOT multi-post into more than a single forum/category.
Re: sql query required [message #185007 is a reply to message #184994] Sat, 29 July 2006 18:03 Go to previous messageGo to next message
vx_2004
Messages: 10
Registered: July 2006
Junior Member
create table temp3 (field1 char(1), field2 number)

insert into temp3 values ('A',1)

insert into temp3 values ('B',2)

SELECT *
FROM ( SELECT FIELD1 FROM TEMP3),
( SELECT FIELD2 FROM TEMP3)

FIELD1|FIELD2
A|1
A|2
B|1
B|2

Is This what you want ??



Re: sql query required [message #185015 is a reply to message #185007] Sun, 30 July 2006 01:13 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Topics merged.
Please do not post the same question in multiple forums (cross-posting).
Re: SQL query required (Merged) [message #185040 is a reply to message #184985] Sun, 30 July 2006 08:54 Go to previous messageGo to next message
Peter D.
Messages: 19
Registered: June 2006
Location: Warsaw, Poland
Junior Member
SELECT t1.col1, t2.col2
FROM my_table t1, my_table t2;


Peter D.

[Updated on: Sun, 30 July 2006 08:55]

Report message to a moderator

Re: sql query required [message #185790 is a reply to message #185007] Thu, 03 August 2006 11:51 Go to previous message
sheharyararshad
Messages: 10
Registered: May 2006
Location: KUWAIT
Junior Member

hello
thank you so much for urs quick response i followed ur query really it works this what i need once again thank u so much for ur coopertaion.
take care
bye
Previous Topic: how to retrive the user domain ?
Next Topic: What is wrong with this query?
Goto Forum:
  


Current Time: Thu Dec 05 06:24:29 CST 2024