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;








0















I have the table _primary with UNIQUE title and i have the table _secondary where i need set reference title for _primary table.



enter image description here










share|improve this question
























  • понятненько нах

    – 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

















0















I have the table _primary with UNIQUE title and i have the table _secondary where i need set reference title for _primary table.



enter image description here










share|improve this question
























  • понятненько нах

    – 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













0












0








0








I have the table _primary with UNIQUE title and i have the table _secondary where i need set reference title for _primary table.



enter image description here










share|improve this question














I have the table _primary with UNIQUE title and i have the table _secondary where i need set reference title for _primary table.



enter image description here







mysql sql database






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • понятненько нах

    – 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












1 Answer
1






active

oldest

votes


















0















Try this solution and let me know its working for you.



ALTER TABLE _secondary
ADD CONSTRAINT FK_title
FOREIGN KEY (title) REFERENCES _primary(title)





share|improve this answer
























    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
    );



    );













    draft saved

    draft discarded


















    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









    0















    Try this solution and let me know its working for you.



    ALTER TABLE _secondary
    ADD CONSTRAINT FK_title
    FOREIGN KEY (title) REFERENCES _primary(title)





    share|improve this answer





























      0















      Try this solution and let me know its working for you.



      ALTER TABLE _secondary
      ADD CONSTRAINT FK_title
      FOREIGN KEY (title) REFERENCES _primary(title)





      share|improve this answer



























        0














        0










        0









        Try this solution and let me know its working for you.



        ALTER TABLE _secondary
        ADD CONSTRAINT FK_title
        FOREIGN KEY (title) REFERENCES _primary(title)





        share|improve this answer













        Try this solution and let me know its working for you.



        ALTER TABLE _secondary
        ADD CONSTRAINT FK_title
        FOREIGN KEY (title) REFERENCES _primary(title)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 5:52









        Vishal RakholiyaVishal Rakholiya

        465 bronze badges




        465 bronze badges





















            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.



















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript