Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,703
Community Members
 
Community Events
184
Community Groups

how to convert postgresql query to oracle

Help me to convert postgresql query to oracle query convers

 

SELECT d.directory_name AS "Directory",
u.user_name AS "Username",
u.active AS "Active",
to_timestamp(CAST(attribute_value AS BIGINT)/1000) AS "Last Login"
FROM cwd_user u
JOIN (
SELECT DISTINCT child_name
FROM cwd_membership m
JOIN licenserolesgroup gp ON m.lower_parent_name = gp.GROUP_ID
) AS m ON m.child_name = u.user_name
LEFT JOIN (
SELECT *
FROM cwd_user_attributes ca
WHERE attribute_name = 'login.lastLoginMillis'
) AS a ON a.user_id = u.ID
JOIN cwd_directory d ON u.directory_id = d.id
ORDER BY "Last Login" DESC;

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 22, 2023

Hi @Mugilan Sukumar ,

please try the following :

SELECT d.directory_name AS "Directory", u.user_name AS "Username", u.active AS "Active", to_timestamp(CAST(attribute_value AS NUMBER)/1000) AS "Last Login" FROM cwd_user u JOIN (SELECT DISTINCT child_name FROM cwd_membership m JOIN licenserolesgroup gp ON m.lower_parent_name = gp.GROUP_ID ) m ON m.child_name = u.user_name LEFT JOIN (SELECT * FROM cwd_user_attributes ca WHERE attribute_name = 'login.lastLoginMillis' ) a ON a.user_id = u.ID JOIN cwd_directory d ON u.directory_id = d.id ORDER BY "Last Login" DESC;

In case of error please share it.

Fabio

Hi @Fabio Racobaldo _Herzum_ 
Thanks for you response.

when i tired to execute above query getting below error message.

 

ORA-00932: inkonsekvente datatyper: forventet -, fikk NUMBER
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Error at Line: 1 Column: 134

Suggest an answer

Log in or Sign up to answer