group by like stringHow to create an Sql table from SELECT with a multiple row DISTINCT constraint?UPDATE...
A dragon's soul trapped in a ring of mind shielding wants a new body; what magic could enable her to do so?
Why does Python copy numpy arrays where the length of the dimensions are the same?
What is the small cylinder on the firewall to the left of the battery?
Why are energy weapons seen as more acceptable in children's shows than guns that fire bullets?
Bacterial growth inhibitors used in Deodorants
Should corporate security training be tailored based on a users' job role?
Does limiting the number of sources help simplify the game for a new DM with new and experienced players?
Is it possible to make a dynamically risizing filesystem-as-file?
Is it appropriate to give a culturally-traditional gift to a female coworker?
Is candidate anonymity at all practical?
Border strip tableau
Why is the movie titled Gothika?
Can neural cryptanalysis be applied to AES?
How does a single engine tail wheel landing gear airplane turn when it is on the ground?
How to run a binary file from crontab?
Why did Tywin never remarry?
Does anyone recognize this inequality?
How can I learn to care less because it makes me sick?
How to not forget my phone in bathroom?
I have a single ethernet switch. Should I use spanning tree?
Did President Obama tell President Trump he was close to starting a war with North Korea?
How do I add numbers from two txt files with Bash?
This Website Needs More Cat Pictures?
How to tell readers your story is a re-imagination of a popular story?
group by like string
How to create an Sql table from SELECT with a multiple row DISTINCT constraint?UPDATE Query replacing string primary key taking days to resolveSelecting aggregated string from databaseHow to calculate shift hours in postgres?DB design for employee working hours constraintsSQL - find records that are prefixes of my stringCan't we make a non-primary key or non-unique key in a table as a foreign key in another table?Postgres Join multiple table to replace id of parent table with valueIs there any string compaction option for PostgreSQL?PostgreSQL results of conditional insert
I have a table employee
in this table i have id company_name employee_id
1 abc 2015_acb_1
2 abc 2015_acb_2
3 abc 2015_acb_3
4 abc 2015_acb_4
5 xyz 2016_xyz_9
5 xyz 2017_xyz_2
5 xyz 2016_xyz_3
5 xyz 2019_xyz_5
I want to select unique string such as from employee table
_abc_
_xyz_
i have try select employee_id where employee_id like %_%;
its not giving as i expected
postgresql postgresql-performance
New contributor
add a comment |
I have a table employee
in this table i have id company_name employee_id
1 abc 2015_acb_1
2 abc 2015_acb_2
3 abc 2015_acb_3
4 abc 2015_acb_4
5 xyz 2016_xyz_9
5 xyz 2017_xyz_2
5 xyz 2016_xyz_3
5 xyz 2019_xyz_5
I want to select unique string such as from employee table
_abc_
_xyz_
i have try select employee_id where employee_id like %_%;
its not giving as i expected
postgresql postgresql-performance
New contributor
Are you always looking for the characters between the two_
characters? Or always for three characters starting at the sixth?
– a_horse_with_no_name
5 hours ago
add a comment |
I have a table employee
in this table i have id company_name employee_id
1 abc 2015_acb_1
2 abc 2015_acb_2
3 abc 2015_acb_3
4 abc 2015_acb_4
5 xyz 2016_xyz_9
5 xyz 2017_xyz_2
5 xyz 2016_xyz_3
5 xyz 2019_xyz_5
I want to select unique string such as from employee table
_abc_
_xyz_
i have try select employee_id where employee_id like %_%;
its not giving as i expected
postgresql postgresql-performance
New contributor
I have a table employee
in this table i have id company_name employee_id
1 abc 2015_acb_1
2 abc 2015_acb_2
3 abc 2015_acb_3
4 abc 2015_acb_4
5 xyz 2016_xyz_9
5 xyz 2017_xyz_2
5 xyz 2016_xyz_3
5 xyz 2019_xyz_5
I want to select unique string such as from employee table
_abc_
_xyz_
i have try select employee_id where employee_id like %_%;
its not giving as i expected
postgresql postgresql-performance
postgresql postgresql-performance
New contributor
New contributor
New contributor
asked 6 hours ago
deviyadeviya
1
1
New contributor
New contributor
Are you always looking for the characters between the two_
characters? Or always for three characters starting at the sixth?
– a_horse_with_no_name
5 hours ago
add a comment |
Are you always looking for the characters between the two_
characters? Or always for three characters starting at the sixth?
– a_horse_with_no_name
5 hours ago
Are you always looking for the characters between the two
_
characters? Or always for three characters starting at the sixth?– a_horse_with_no_name
5 hours ago
Are you always looking for the characters between the two
_
characters? Or always for three characters starting at the sixth?– a_horse_with_no_name
5 hours ago
add a comment |
1 Answer
1
active
oldest
votes
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
ofemployee_id
field startingFROM 5
th symbolFOR 5
chars length)
.
– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
|
show 2 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
deviya is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230097%2fgroup-by-like-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
ofemployee_id
field startingFROM 5
th symbolFOR 5
chars length)
.
– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
|
show 2 more comments
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
ofemployee_id
field startingFROM 5
th symbolFOR 5
chars length)
.
– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
|
show 2 more comments
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;
SELECT DISTINCT SUBSTRING(employee_id FROM 5 FOR 5)
FROM employee;
answered 6 hours ago
AkinaAkina
4,0361311
4,0361311
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
ofemployee_id
field startingFROM 5
th symbolFOR 5
chars length)
.
– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
|
show 2 more comments
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
ofemployee_id
field startingFROM 5
th symbolFOR 5
chars length)
.
– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
what is 5 FOR 5 ?
– deviya
6 hours ago
what is 5 FOR 5 ?
– deviya
6 hours ago
SELECT DISTINCT SUBSTRING(
of employee_id
field starting FROM 5
th symbol FOR 5
chars length )
.– Akina
6 hours ago
SELECT DISTINCT SUBSTRING(
of employee_id
field starting FROM 5
th symbol FOR 5
chars length )
.– Akina
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
sir some of record contains 3 to 4 _ symbol and position is different
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
like 2017_HCL_012346_3_4 and 2016_TCS_375_875_2
– deviya
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
What do you want from these strings then?
– Lennart
6 hours ago
|
show 2 more comments
deviya is a new contributor. Be nice, and check out our Code of Conduct.
deviya is a new contributor. Be nice, and check out our Code of Conduct.
deviya is a new contributor. Be nice, and check out our Code of Conduct.
deviya is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230097%2fgroup-by-like-string%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you always looking for the characters between the two
_
characters? Or always for three characters starting at the sixth?– a_horse_with_no_name
5 hours ago