Jump to content

tricky SQL questions please


mettastar

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

  • mettastar

    25

  • rakeshchinna

    9

  • former

    6

  • Srimantudu

    3

Popular Days

Top Posters In This Topic

2 minutes ago, mettastar said:

what is the relation vuncle.. question is not clear... 

24567898  ->12345668

 

how are these two related? 

first set lo first dhi second set lo first dhi ala relate chesava ?

pattern choosi think uncle oka column lo 8 rows unnayi 4 rows oka column lo kavali inko 4 rows inko column lo kavali 

Link to comment
Share on other sites

Just now, rakeshchinna said:

pattern choosi think uncle oka column lo 8 rows unnayi 4 rows oka column lo kavali inko 4 rows inko column lo kavali 

i got that but , A-->B relation ela telusthadi.. can I get 4 rows from second set into B column in any random order ?

Link to comment
Share on other sites

2 minutes ago, mettastar said:

i got that but , A-->B relation ela telusthadi.. can I get 4 rows from second set into B column in any random order ?

yes in any random order

Link to comment
Share on other sites

with a as

select a, rank() over(partition by substring(a,1,1) order by a ) rnk from table

select a1.a, a2.a

from a a1 inner join a a2 on a1.rnk=a2.rnk and substring(a2.a='1') and substring(a1.a='2')

 

any other best/simple solution for this

 

Link to comment
Share on other sites

2 minutes ago, mettastar said:

with a as

select a, rank() over(partition by substring(a,1,1) order by a ) rnk from table

select a1.a, a2.a

from a a1 inner join a a2 on a1.rnk=a2.rnk and substring(a2.a='1') and substring(a1.a='2')

 

any other best/simple solution for this

 

@rakeshchinna

Link to comment
Share on other sites

44 minutes ago, mettastar said:

I want now.. meru general ga interview lo face chesina questions or meru interview chesetapudu adige questions veyandi

Join on the Null Value? How to handle null values in the join ?

Link to comment
Share on other sites

1 minute ago, former said:

Join on the Null Value? How to handle null values in the join ?

Nulls meda join avadhu .. so NVL use chesi convert null to some default to join

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...