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

1 minute ago, rakeshchinna said:

I still have doubt on using rank or row_number() confirm chesukovalii experts row_number() ani chepparu

u r right may be we have to use row_number() to avoid duplication

Link to comment
Share on other sites

Just now, rakeshchinna said:

Identity column vinaledu ante needi PL/SQL back ground aah broo

ledu .. ETL side .. but oracle tho work chesi chaala rojulu aindhi

Link to comment
Share on other sites

Write a T-SQL to fetch first Name, Initial, Last Name and Suffix from Full Name Column

EmployeeID FullName
1 Nancy Davolio
2 Andrew W Fuller Jr
3 Janet Leverling
4 Margaret Peacock
5 Steven Buchanan
6 Michael J Suyama Jr
7 Robert T King III
8 Laura Callahan
9 Anne Dodsworth

Expected Output

EmployeeID FullName FirstName Initial LastName Suffix
1 Nancy Davolio Nancy   Davolio  
2 Andrew W Fuller Jr Andrew W Fuller Jr
3 Janet Leverling Janet   Leverling  
4 Margaret Peacock Margaret   Peacock  
5 Steven Buchanan Steven   Buchanan  
6 Michael J Suyama Jr Michael J Suyama r
7 Robert T King III Robert T King III
8 Laura Callahan Laura   Callahan  
9 Anne Dodsworth Anne   Dodsworth  

 

 

Link to comment
Share on other sites

53 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 ?

8 rows unnay.. aa data set lo..

4 pakkana migitha 4 ravali..

pivoting  type annattu.. cheyy

Link to comment
Share on other sites

14 minutes ago, former said:

Assume the table don't have any date or timestamp data type or don't have time or date representative fields. How to do know when the table last  insert or update happened ?

Logs chudali

Link to comment
Share on other sites

10 minutes ago, Suhaas said:

Write a T-SQL to fetch first Name, Initial, Last Name and Suffix from Full Name Column

EmployeeID FullName
1 Nancy Davolio
2 Andrew W Fuller Jr
3 Janet Leverling
4 Margaret Peacock
5 Steven Buchanan
6 Michael J Suyama Jr
7 Robert T King III
8 Laura Callahan
9 Anne Dodsworth

Expected Output

EmployeeID FullName FirstName Initial LastName Suffix
1 Nancy Davolio Nancy   Davolio  
2 Andrew W Fuller Jr Andrew W Fuller Jr
3 Janet Leverling Janet   Leverling  
4 Margaret Peacock Margaret   Peacock  
5 Steven Buchanan Steven   Buchanan  
6 Michael J Suyama Jr Michael J Suyama r
7 Robert T King III Robert T King III
8 Laura Callahan Laura   Callahan  
9 Anne Dodsworth Anne   Dodsworth  

PS: No googling :)

 

Substring and length batti case statement rayali

Link to comment
Share on other sites

23 minutes ago, former said:

Assume the table don't have any date or timestamp data type or don't have time or date representative fields. How to do know when the table last  insert or update happened ?

identity column use cheyachu insert check cheyadaniki then use scope_identity function

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...