Skip to content
Advertisement

Tag: oracle

Oracle developer. ORA-01722 Invalid Number when using UNION

I have this problem: I have two tables: Table A and Table B, with the same column called PK_COLUMN that in both tables are numeric(8, 0). I want to make this union: And I got the next error code: ORA-01722 Invalid number. The problem is that when I execute the both parts of the union separately they work perfectly! Answer

Why is the return type of sysdate DATE? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 months ago. Improve this question Sysdate returns the current system date and time and its return type is of date. But shouldn’t date type only contain

Select the Max row number for an account

I need to only pull the max row number for an account. I know it’s a grouping issue. Current data: ACCOUNT_UID ID NAME ACADEMIC_PERIOD CAT_BY_DATE CAT_DATE MAX_ROW abc abc Popeye 202190 CPT 9/15/2021 1 abc abc Popeye 202190 CSH 10/4/2021 2 I only need the second row. Current query: Answer You can try the following: The idea is to apply

How to get mean of exams by client with 2 tables?

I know a little bit of sql, only the basic, now I need to create a analytic query but can’t do this yet. I have 2 tables on my db oracle, client and exams: I am tried a lot of ways to get the mean of exams by client, but no success yet.4 The result expected is: exams = 13

What does INTERVAL ‘182’ DAY(3) mean in SQL / Oracle?

Trying to understand INTERVAL and DAY(3) usage in SQL, as I’ve come across it and need to understand what it means. It’s in a WHERE clause, seen below WHERE POSTING_DATE > CURRENT_DATE – INTERVAL ‘182’ DAY(3) Help needed, thanks! Answer From the documentation: INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds.

Transpose rows to columns using multiple pivots

I am trying to transpose rows to columns without any luck . What I have now WEEK_NUMBER VAL9 VAL4 VAL5 VAL7 45 63.27% 28.58% 7.92% 0.23% 52 65.66% 26.16% 7.80% 0.38% 50 90.97% 8.45% 0.29% 0.29% 46 82.49% 12.43% 3.01% 2.06% 47 66.33% 29.53% 3.77% 0.36% 51 65.36% 31.83% 2.69% 0.11% 49 61.88% 28.29% 9.46% 0.37% 44 45.34% 45.55% 8.45%

select only those who have no contact

I updated my question. I have table like this: id name contact 1 A 65489 1 A 1 A 45564 2 B so, i want table like this: id name contact 2 B Answer Using exists logic we can try: In plain English, the above query says to return any records for which we cannot find another record belonging to

Advertisement