Reference `title` from another table `title`How to list the tables in a SQLite database file that was opened with ATTACH?Add a column with a default value to an existing table in SQL ServerSQL update from one Table to another based on a ID matchTable Naming Dilemma: Singular vs. Plural NamesInserting multiple rows in a single SQL query?Insert results of a stored procedure into a temporary tableHow do I UPDATE from a SELECT in SQL Server?Finding duplicate values in a SQL tableWhat are the options for storing hierarchical data in a relational database?Insert into a MySQL table or update if exists
Do we know the problems the University of Manchester's Transistor Computer was intended to solve?
Received email from ISP saying one of my devices has malware
Why would a Intel 8080 chip be destroyed if +12 V is connected before -5 V?
Does the Scrying spell require you to have a clear path to the target in order to work?
Ideal characterization of almost convergence
One hour 10 min layover in Newark; International -> Domestic connection. Enough time to clear customs?
Why do old games use flashing as means of showing damage?
Playing boules... IN SPACE!
garage light with two hots and one neutral
Why KVM VPS is slower then OPENVZ
Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code
Sum of Infinite series with a Geometric series in multiply
Are there any writings by blinded and/or exiled Byzantine emperors?
Is it safe for a student to give negative feedback in student evaluations?
properties that real numbers hold but complex numbers does not
Taking the first element in a list of associations
If the UK government illegally doesn't ask for article 50 extension, can parliament do it instead?
Why don't they build airplanes from 3D printer plastic?
Is there anything in the universe that cannot be compressed?
How to check status of Wi-Fi adapter through command line?
Heuristic argument for the Riemann Hypothesis
Function of the separated, individual solar cells on Telstar 1 and 2? Why were they "special"?
How does Harry wear the invisibility cloak?
Are manifolds admitting a circle foliation covered by manifolds with a (non-trivial) circle action?
Reference `title` from another table `title`
How to list the tables in a SQLite database file that was opened with ATTACH?Add a column with a default value to an existing table in SQL ServerSQL update from one Table to another based on a ID matchTable Naming Dilemma: Singular vs. Plural NamesInserting multiple rows in a single SQL query?Insert results of a stored procedure into a temporary tableHow do I UPDATE from a SELECT in SQL Server?Finding duplicate values in a SQL tableWhat are the options for storing hierarchical data in a relational database?Insert into a MySQL table or update if exists
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have the table _primary
with UNIQUE title
and i have the table _secondary
where i need set reference title
for _primary
table.
mysql sql database
add a comment |
I have the table _primary
with UNIQUE title
and i have the table _secondary
where i need set reference title
for _primary
table.
mysql sql database
понятненько нах
– John John
Mar 28 at 2:12
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30
add a comment |
I have the table _primary
with UNIQUE title
and i have the table _secondary
where i need set reference title
for _primary
table.
mysql sql database
I have the table _primary
with UNIQUE title
and i have the table _secondary
where i need set reference title
for _primary
table.
mysql sql database
mysql sql database
asked Mar 28 at 1:47
John JohnJohn John
186 bronze badges
186 bronze badges
понятненько нах
– John John
Mar 28 at 2:12
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30
add a comment |
понятненько нах
– John John
Mar 28 at 2:12
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30
понятненько нах
– John John
Mar 28 at 2:12
понятненько нах
– John John
Mar 28 at 2:12
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30
add a comment |
1 Answer
1
active
oldest
votes
Try this solution and let me know its working for you.
ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
);
);
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%2fstackoverflow.com%2fquestions%2f55389001%2freference-title-from-another-table-title%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
Try this solution and let me know its working for you.
ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)
add a comment |
Try this solution and let me know its working for you.
ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)
add a comment |
Try this solution and let me know its working for you.
ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)
Try this solution and let me know its working for you.
ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)
answered Mar 28 at 5:52
Vishal RakholiyaVishal Rakholiya
465 bronze badges
465 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f55389001%2freference-title-from-another-table-title%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
понятненько нах
– John John
Mar 28 at 2:12
Sorry but I do not understand this question. What problem are you having doing this.
– TomC
Mar 28 at 4:30