Linked Questions

125 votes
11 answers
519k views

I have a simple query: select * from countries with the following results: country_name ------------ Albania Andorra Antigua ..... I would like to return the results in one row, so like this: ...
rics's user avatar
  • 5,616
82 votes
4 answers
382k views

How can I achieve the following in oracle without creating a stored procedure? Data Set: question_id element_id 1 7 1 8 2 9 3 10 3 ...
Dan Polites's user avatar
  • 6,830
63 votes
1 answer
122k views

My inputs are in this way. col1 col2 1 a 1 b 2 c 2 d 2 e O/p: Should Be like col1 col2 1 a,b 2 c,d,e I want a query that can be fired at DB level. I've ...
Prashanth's user avatar
  • 1,304
32 votes
7 answers
95k views

I have a table that looks like this: A 1 A 2 B 1 B 2 And I want to produce a result set that looks like this: A 1 2 B 1 2 Is there a SQL statement that will do this? I am using Oracle. Related ...
user128807's user avatar
  • 10.6k
4 votes
2 answers
33k views

Let’ say I have a table with 3 columns ID INTEGER, OFFSET INTEGER, STR VARCHAR(50) Containing values: ID OFFSET STR 1 1 TestSTR1 1 2 ...
Sachin Kulkarni's user avatar
9 votes
2 answers
12k views

I have a Oracle 11g XE database and I have a query the result set: ID Category 1 Cat1 1 Cat2 2 Cat3 2 Cat4 I want to get distinct id's with all related categories in same row as comma ...
Murmelto's user avatar
  • 172
0 votes
1 answer
15k views

I have a table like this: I need a query (no PL/SQL) that shows this output: So for each Product ID I want the distinct values of Delivery Type in the field Delivery Type. Is there a way to get this ...
thwomp68's user avatar
  • 165
2 votes
1 answer
5k views

I have a table called MY_MOVIES with two columns: MOVIES and GENRES like this (the relationship is one movie to many genres): GENRE MOVIE ---------- -------------- ACTION ...
Gordon Shumway's user avatar
3 votes
1 answer
2k views

Don't we hate when evil coding comes back to haunt? Some time ago I needed to generate a string concatenating some fields for some more processing later. I thought it would be a good idea to do if ...
filippo's user avatar
  • 5,823
-1 votes
1 answer
5k views

I am stuck in situation where I need a comma separated list from group by result sets. Let me give you a typical schema : username | lotno | img ------------------------ ...
Samcoder's user avatar
  • 345
-2 votes
1 answer
3k views

I have a query like: select a.id, b.value from a left join b on a.name = b.name where a.id = 12345; And I get results like id value -------- 12345 value1 12345 value2 However I would like to get a ...
SwiftMango's user avatar
  • 15.4k
1 vote
1 answer
4k views

I have below select query: select distinct(e.ENGINE_ID), e.ENGINE_NAME, os.OBJECT_STATUS, br.NAME, env.NAME from ENGINE e, RATOR_MONITORING.OBJECT_STATUS os, ...
Marcus's user avatar
  • 4,021
1 vote
1 answer
4k views

I have a package in oracle that contains one stored procedure. It takes a date as a input and a number as input, and outputs the data into a ref_cursor. The purpose of the stored procedure is to ...
javascript Jenkins's user avatar
0 votes
2 answers
2k views

I have a table like this id | Name =========== 1 | A 2 | A 3 | A 4 | B 5 | B 6 | C i am writing select id from tbl where name = "A", i want to get all three ids (1,2,3) like this ...
learner1's user avatar
  • 116
0 votes
2 answers
2k views

I'm having trouble explaining this, so if someone can make adjustments to the title or question then please do. I have a simple SQL query that I'm running SELECT orders.customer_no, orders.order_no ...
user3636943's user avatar

15 30 50 per page
1
2 3 4 5
7