Home » SQL & PL/SQL » SQL & PL/SQL » Comparing daywise data
Comparing daywise data [message #675785] Sat, 20 April 2019 00:19 Go to next message
viveklnt
Messages: 3
Registered: April 2019
Junior Member
Hi to all,

Below is my table structure.

DPR_DATE COLLECTION MONTH_DAY_SEQ
01-03-19 1565470 1
02-03-19 212845 2
03-03-19 2730910 3
05-03-19 1844000 4
02-04-19 1327390 1
03-04-19 1010550 2
04-04-19 991730 3
05-04-19 1278270 4


This is the sales data of first 4 days of two month data.

I want the output as like this.

Day_Seq March_Data(collection) April_Data(collection)
1 1565470 1327390
2 2128450 1010550
3 2730910 991730
4 1844000 1278270

Please help.

Regards

Vivek

Re: Comparing daywise data [message #675786 is a reply to message #675785] Sat, 20 April 2019 00:47 Go to previous messageGo to next message
Michel Cadot
Messages: 67363
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: Comparing daywise data [message #675788 is a reply to message #675786] Sat, 20 April 2019 01:12 Go to previous messageGo to next message
viveklnt
Messages: 3
Registered: April 2019
Junior Member
Sorry michel,

I am not able to format my posts with html code.

i want the result like this Day, 1st month collection, 2nd month collection.
Re: Comparing daywise data [message #675789 is a reply to message #675788] Sat, 20 April 2019 01:36 Go to previous messageGo to next message
Michel Cadot
Messages: 67363
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You didn't read the links I provided, did you?

You have to EXPLAIN WITH DETAILS what you want.
Why "1 1565470 1327390" where do come each column? Why have they these values?

Read again my post to know what you have to provide.

Re: Comparing daywise data [message #675790 is a reply to message #675789] Sat, 20 April 2019 02:11 Go to previous messageGo to next message
viveklnt
Messages: 3
Registered: April 2019
Junior Member
Hi,

Sorry once again for not being specific.

my table structure .

Name Null Type
------------- -------- ------------
DPR_DATE NOT NULL DATE
TOURIST NUMBER(38)
BUS NUMBER(38)
ENTRY NUMBER(38)
VG NUMBER(38)
EE NUMBER(38)
EVG NUMBER(38)
EEE NUMBER(38)
VGEE NUMBER(38)
COLLECTION NUMBER(38)
MONTH_DAY_SEQ VARCHAR2(12)


This table contains daywise collection data with working day of each day.

My required result is First day sales of all month in one single line.

For example :

Day 1 , Jan data, Feb data, March data, April Data
Re: Comparing daywise data [message #675791 is a reply to message #675790] Sat, 20 April 2019 02:17 Go to previous message
Michel Cadot
Messages: 67363
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What don't you understand in "create table (including all constraints) and insert statements"?
Did I speak about DESC?
And you still don't read the link about formatting your post.

Search for PIVOT in the documentation.
This is the last post I gave if you don't post what is required.

Previous Topic: Problem with selecting data
Next Topic: json fetching using JSON_TABLE
Goto Forum:
  


Current Time: Tue Sep 22 10:34:08 CDT 2020