Skip to content
Advertisement

Tag: oracle

How to find the degree of connection in a social network using recursion

Imagine, you are looking at a social network graph of millions of users. Imagine Facebook users who are in different Facebook Groups. Let me give the following example: We start with Jeff. Jeff has a degree of connection with himself of 0. Rohit is in the same Facebook group as Jeff, so his degree of connection with Jeff is 1.

Getting not valid month in Oracle sql

I have a table called Transactions that has a column called trans_date. I am just trying to do a simple query in the SQL*Plus command window The query is When I run this query I get not valid month and there is a little * under trans_date. Most of what I have read suggests the query is right but I

Delete node when child have a certain value is found

I intend to remove a node whenever I find the unit_qty tag with the value equal to 0.0000. For example considering that the message below is called MESSAGE_DATA: the purpose of message_data is to return the following: I’ve already tried the following options: I don’t know if I’m looking up the tag wrong but I’ve tried it with several formats

Oracle Case Statement and efficency

I have a piece of my Oracle Query i need to optimize a little line.quantity comes out from other part o query, for this example is not needed i think. I would like to calculate only once SUM(dnl.quantity) instead ad every iteraciotn, somethink like But obviously this give error at the second and 3rd WHEN Answer You are over-optimizing. The

Oracle SQL return column calculated from existing columns

I have the above SQL query which returns the columns name, X and Y. I would like to return one more column (lets call it Z) which gives the value of X/Y but not too sure how to do this – I tried writing (X/Y) Z but no luck – any suggestions? Answer Use CTE

Column containing the product of elements in a second column, sorted by group

I have the following SQL script, , which yields, I wish to create a column, Product, that contains the product of Numbers on each date within the same BM group: To clarify, for BM =’AA’ the product should be 1*2*3*4*5=120. Thank you in advance! Best regards, Answer There isn’t a built-in product function; but you could use the exp/ln technique

Advertisement