Skip to content
Advertisement

Tag: oracle

Gather the number of customer by street

I have two tables : Customer: id name address_id 1 John 4 2 Kate 5 3 Bob 2 4 Michael 2 5 Adriana 3 6 Ann 1 Address: id detail_str_name city district street_name 1 France,Paris,str.2,N5 Paris Paris str.2 2 France,Parise,str.2 ,N3 Paris Paris str.2 3 France, Lille ,str.3,N4 Lille Lille str.3 4 France,Paris,str.4,N3 Paris Paris str.4 5 France, Paris, Batignolles,N4

How to use DENSE_RANK and order by aditional column?

I am trying to use dense_rank to get element order for instance: I have table seq_test with data: after I run the code above, I’ve got : I want to achieve: So DENSE_RANK() function use its own order defined in function definition I need to order the SEQ column by sequence column. Update: I want to get: Answer Since the

count business days in calculation

Continuing from my previous question: case when date column is greater than sysdate then ‘Y’ One thing I forgot to consider was including working days in the calculation. Here is the query: So I need to exclude Saturday and Sunday in the calculation above. I tried to add this in the where clause: But the calculation does not seem to

Getting a not valid month and need to insert records in incremental manner

The problem which I am facing: I need to convert timestamp to date and then insert it into the deligate_details_trans for the completed_date column of the deligate_details_main table. When I am converting it is giving ORA-01843: not a valid month error. Currently, deligate_details_main has 3 rows that are going to be inserted into the deligate_details_trans table but if any rows

choose from a time period oracle sql

I have timestamp date format in column FIRST_DATE and i need to choose time period from a certain hour, for ex. all from 18:00 10.05.21 to 18:00 11.05.2021 the problem is that date column in timestamp format – FIRST_DATE: 10/05/2020 0:00:03,000000 TIMESTAMP(6) so i tried to use it: so with this way i was able to limit the start period

Limit number of occurrences of value in a table oracle sql

I have oracle sql table of students, students are assigned to groups. I have to set constraint so there will be no more than 10 students in a group (ideally no more than N students in a group). Basically restrict table from having more than N rows with the same GROUP_ID value. Here is table declaration. I’ve tried to use

Advertisement