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
Tag: oracle
how to set concatenated string parameter in preparedstatement
I have the following java code: I get the following exception in codeline 3-: Invalid column index What did I do wrong? how to set params correctly? Answer Take the bind parameters out of the string literal: Or, create a single bind parameter and pass in the concatenated value:
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
Is there a way to check the ‘Connection path’ between two tables using oracle?
For two given tables ‘foo’ and ‘bar’ is there a way to write a SQL Query that return the path connection between those? [ foo ] —> [ n’tables ] —> [ bar ] I also want to check if there is a way to know if there is a valid connection path that connects two different tables in a
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.
SQL fill empty values in a column based on case when selection
So basically what I want to achieve is that if four columns are empty, one column contains a 1 as value and one column contains 0, then I want to entries in one column meeting the conditions with a default value (0.06077). Meaning: IF COL_A, COL_B, COL_C, COL_D IS NULL and COL_E = 0 AND COL_F = 0 then fill
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