[Solved] Null result for date object fetched from DB giving sysDate/current date on mapping to Java object

Found the reason. When the BeanPropertyRowMapper was provided with Date.class for mapping, new Date() is called for instantiation of the class like for any object. But for Date.class, new Date() returns sysDate. solved Null result for date object fetched from DB giving sysDate/current date on mapping to Java object

[Solved] Fetching Unmatching/Rejected rows

It appears that you want to do something like select * from Tab1 LEFT OUTER join Tab2 on Tab1.col1=Tab2.col1 and Tab1.col2=Tab2.col3 and Tab1.col4=Tab2.col5 AND Tab2.col3=<value> LEFT OUTER join Tab3 ON (TAB3.SOMETHING = TAB1.SOMETHING OR TAB3.SOMETHING_ELSE = TAB2.SOMETHING_ELSE) AND Tab3.col2=<value> and WHERE Tab1.col3=<value> and Tab1.col4=<value> AND TAB2.PRIMARY_KEY IS NULL AND TAB3.PRIMARY_KEY IS NULL; Note the use … Read more

[Solved] SQL JOIN for three tables

select * from tbl_Service where sId not in (select ser_Id from tbl_quat_ID where quat_Id != <qID>) i hope qID is passed from application side.. you just need to append the string to pass proper value there 1 solved SQL JOIN for three tables

[Solved] object creation generates error in oracle

The afiseaza_animal procedure belongs to the type and you need to define it in the body of the type (using CREATE TYPE BODY) and not as a standalone procedure (using CREATE PROCEDURE). DROP TYPE specii_inr; CREATE TYPE specii_inr UNDER gestiune_zoo ( specii_inrudite VARCHAR2(20), OVERRIDING member procedure afiseaza_animal ); / CREATE OR REPLACE TYPE BODY specii_inr … Read more

[Solved] How to get first three characters of a string and last three character of the same string in oracle, and display them, what will be the query?

How to get first three characters of a string and last three character of the same string in oracle, and display them, what will be the query? solved How to get first three characters of a string and last three character of the same string in oracle, and display them, what will be the query?

[Solved] SQL Rows into Columns

You cannot achieve this with transpose. rather try using natural full outer join WITH T AS (SELECT P.*, ROW_NUMBER ( ) OVER (PARTITION BY PERSON, LEVELS ORDER BY LANGUAGE) R FROM PROGRAMMER P) SELECT PERSON, SENIOR, MID, JUNIOR FROM (SELECT PERSON, R, LANGUAGE SENIOR FROM T WHERE LEVELS = ‘SENIOR’) NATURAL FULL OUTER JOIN (SELECT … Read more

[Solved] how to use ‘GROUP BY’ function with below query

Do you mean like this? SELECT * FROM ( SELECT a.id, a.name, c.code, a.active_dt, a.inactive_dt, b.category, COUNT(1) OVER(PARTITION BY a.id, a.name, c.code) AS CNT FROM student a, class b, descrip c WHERE a.id=b.id AND a.id=c.id ) WHERE CNT > 1 0 solved how to use ‘GROUP BY’ function with below query

[Solved] data not showing with sno

The following should get what you’re asking for: INSERT INTO SOME_TABLE (SNO, USERID) VALUES ((SELECT NVL(MAX(SNO)+1, 1) FROM SOME_TABLE WHERE USERID = &userid), &userid); where &userid is your USERID value. SQLFiddle here 1 solved data not showing with sno

[Solved] How to query in Oracle [closed]

here is how you could go about the two tasks: Query HOLDEVENT twice, so you get records with an event, an organizing club and another organizing club. Think of a way not to get both event = “Event 1” | club1 = “Club A” | club2 = “Club B” and event = “Event 1” | … Read more

[Solved] Get the minimum employees with a given job

Here the key is to get the count of Employee doing particular job in each department. In below query, this is achieved by subquery. Then, we want to get the Department with minimum no. of employee doing that job so we ordered the records returned by subquery in ascending and then select the first result … Read more

[Solved] Calculate time diffrence in SQL with shifts

Use a recursive sub-query factoring clause to generate each day within your time ranges and then correlate that with your shifts to restrict the time for each day to be within the shift hours and then aggregate to get the total: Oracle 18 Setup: CREATE TABLE times ( start_date, End_Date ) AS SELECT DATE ‘2017-02-21’ … Read more

[Solved] insert tokenized strings from a table to other [closed]

If FULLNAME always consists of 3 parts (which is what you said), then it is relatively simple, using the REGEXP_SUBSTR regular expression function: SQL> with test (fullname) as 2 (select ‘Metro Goldwyn Mayer’ from dual 3 ) 4 select regexp_substr(fullname, ‘\w+’, 1, 1) first_name, 5 regexp_substr(fullname, ‘\w+’, 1, 2) middle_name, 6 regexp_substr(fullname, ‘\w+’, 1, 3) … Read more

[Solved] what am I doing wrong with this script [closed]

Remove _t_contient from the script and try. Create table contient( Num_Spect varchar(30) not null, Code_Module varchar(30) not null, constraints pk_contient primary key (Num_Spect,Code_Module), constraints fk_spect FOREIGN key (Num_Spect) REFERENCES specialite(Num_Spect), constraints fk_module FOREIGN key (Code_Module) REFERENCES module(Code_Module)); solved what am I doing wrong with this script [closed]