- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 11:51 AM
Table has the following Columns:
First_Name, Last_Name, Department_Id,Contact_No, Hire_Date
Display the emplopyee First_name, Count of Characters in the firstname,password.
Password should be first 4 letters of first name in lower case and the date and month of Hire_date
Example:
First_Name: SANJEEV
Hire_Date: 25-02-2016
Then password should be SANJ2502
- Labels:
-
Lower Case
-
Spark scala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 12:15 PM
@SANJEEV BANDRU ,
SELECT
CONCAT(substring(First_Name, 0, 2) , substring(Hire_Date, 0, 2), substring(Hire_Date, 3, 2)) as password
FROM
table;If Hire_date is timestamp you may need to add date_format()
My blog: https://databrickster.medium.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 03:06 PM
Hi @SANJEEV BANDRU ,
Just checking if you still need help or if @Hubert Dudek 's response help you to resolve your question? please let us know.