FROM keyword not found where expected (Oracle SQL)

Multi tool use
Multi tool use





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I am currently working on some select queries and am getting the error FROM keyword not found where expected in my last two queries, and I can;t for the life of me figure out what the problem is...



Here are my queries



SELECT Title, PubID AS 'Publisher ID', PubDate AS 'Publish Date' 
FROM Books WHERE PubID = 4 OR PubDate > '01-Jan-01'
ORDER BY PubID ASC;

SELECT Title, (((Retail-Cost)/Cost) * 100) AS 'Markup %'
FROM Books;


I am not sure if my math is correct in this one (retail - cost / cost * 100 is the goal).



I have been trying for probably 45 minutes on the first query before giving up and doing the last one, to only get the same error on that one.










share|improve this question




















  • 4





    You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

    – Rachcha
    Mar 31 '14 at 4:14











  • Which database are you actually using? You've tagged this for both Oracle and MySQL.

    – Justin Cave
    Mar 31 '14 at 4:16











  • @Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

    – Meta
    Mar 31 '14 at 4:56


















2















I am currently working on some select queries and am getting the error FROM keyword not found where expected in my last two queries, and I can;t for the life of me figure out what the problem is...



Here are my queries



SELECT Title, PubID AS 'Publisher ID', PubDate AS 'Publish Date' 
FROM Books WHERE PubID = 4 OR PubDate > '01-Jan-01'
ORDER BY PubID ASC;

SELECT Title, (((Retail-Cost)/Cost) * 100) AS 'Markup %'
FROM Books;


I am not sure if my math is correct in this one (retail - cost / cost * 100 is the goal).



I have been trying for probably 45 minutes on the first query before giving up and doing the last one, to only get the same error on that one.










share|improve this question




















  • 4





    You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

    – Rachcha
    Mar 31 '14 at 4:14











  • Which database are you actually using? You've tagged this for both Oracle and MySQL.

    – Justin Cave
    Mar 31 '14 at 4:16











  • @Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

    – Meta
    Mar 31 '14 at 4:56














2












2








2








I am currently working on some select queries and am getting the error FROM keyword not found where expected in my last two queries, and I can;t for the life of me figure out what the problem is...



Here are my queries



SELECT Title, PubID AS 'Publisher ID', PubDate AS 'Publish Date' 
FROM Books WHERE PubID = 4 OR PubDate > '01-Jan-01'
ORDER BY PubID ASC;

SELECT Title, (((Retail-Cost)/Cost) * 100) AS 'Markup %'
FROM Books;


I am not sure if my math is correct in this one (retail - cost / cost * 100 is the goal).



I have been trying for probably 45 minutes on the first query before giving up and doing the last one, to only get the same error on that one.










share|improve this question
















I am currently working on some select queries and am getting the error FROM keyword not found where expected in my last two queries, and I can;t for the life of me figure out what the problem is...



Here are my queries



SELECT Title, PubID AS 'Publisher ID', PubDate AS 'Publish Date' 
FROM Books WHERE PubID = 4 OR PubDate > '01-Jan-01'
ORDER BY PubID ASC;

SELECT Title, (((Retail-Cost)/Cost) * 100) AS 'Markup %'
FROM Books;


I am not sure if my math is correct in this one (retail - cost / cost * 100 is the goal).



I have been trying for probably 45 minutes on the first query before giving up and doing the last one, to only get the same error on that one.







mysql sql oracle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 31 '14 at 4:21









JasonMArcher

9,461104849




9,461104849










asked Mar 31 '14 at 4:12









MetaMeta

89241526




89241526








  • 4





    You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

    – Rachcha
    Mar 31 '14 at 4:14











  • Which database are you actually using? You've tagged this for both Oracle and MySQL.

    – Justin Cave
    Mar 31 '14 at 4:16











  • @Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

    – Meta
    Mar 31 '14 at 4:56














  • 4





    You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

    – Rachcha
    Mar 31 '14 at 4:14











  • Which database are you actually using? You've tagged this for both Oracle and MySQL.

    – Justin Cave
    Mar 31 '14 at 4:16











  • @Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

    – Meta
    Mar 31 '14 at 4:56








4




4





You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

– Rachcha
Mar 31 '14 at 4:14





You need to use double quote (") instead of single quotes in your column aliases. Use aliases as PubID AS "Publisher ID" and you'll be fine.

– Rachcha
Mar 31 '14 at 4:14













Which database are you actually using? You've tagged this for both Oracle and MySQL.

– Justin Cave
Mar 31 '14 at 4:16





Which database are you actually using? You've tagged this for both Oracle and MySQL.

– Justin Cave
Mar 31 '14 at 4:16













@Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

– Meta
Mar 31 '14 at 4:56





@Rachcha that did the trick, idk how I didnt notice that or find anything anywhere else I was looking and pickup on the fact that it was double quotes... Been a long weekend for me I guess!

– Meta
Mar 31 '14 at 4:56












1 Answer
1






active

oldest

votes


















7














Single quotes are used to surround string literals. Double quotes are used to surround identifiers. Column aliases are identifiers so you'd want to use double quotes



SELECT Title, 
PubID AS "Publisher ID",
PubDate AS "Publish Date"
FROM Books
WHERE PubID = 4
OR PubDate > '01-Jan-01'
ORDER BY PubID ASC;





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%2f22753519%2ffrom-keyword-not-found-where-expected-oracle-sql%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









    7














    Single quotes are used to surround string literals. Double quotes are used to surround identifiers. Column aliases are identifiers so you'd want to use double quotes



    SELECT Title, 
    PubID AS "Publisher ID",
    PubDate AS "Publish Date"
    FROM Books
    WHERE PubID = 4
    OR PubDate > '01-Jan-01'
    ORDER BY PubID ASC;





    share|improve this answer




























      7














      Single quotes are used to surround string literals. Double quotes are used to surround identifiers. Column aliases are identifiers so you'd want to use double quotes



      SELECT Title, 
      PubID AS "Publisher ID",
      PubDate AS "Publish Date"
      FROM Books
      WHERE PubID = 4
      OR PubDate > '01-Jan-01'
      ORDER BY PubID ASC;





      share|improve this answer


























        7












        7








        7







        Single quotes are used to surround string literals. Double quotes are used to surround identifiers. Column aliases are identifiers so you'd want to use double quotes



        SELECT Title, 
        PubID AS "Publisher ID",
        PubDate AS "Publish Date"
        FROM Books
        WHERE PubID = 4
        OR PubDate > '01-Jan-01'
        ORDER BY PubID ASC;





        share|improve this answer













        Single quotes are used to surround string literals. Double quotes are used to surround identifiers. Column aliases are identifiers so you'd want to use double quotes



        SELECT Title, 
        PubID AS "Publisher ID",
        PubDate AS "Publish Date"
        FROM Books
        WHERE PubID = 4
        OR PubDate > '01-Jan-01'
        ORDER BY PubID ASC;






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 31 '14 at 4:15









        Justin CaveJustin Cave

        190k18292324




        190k18292324
































            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%2f22753519%2ffrom-keyword-not-found-where-expected-oracle-sql%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







            JA3LJz B4 Z yW4 mYS3do4kU3jNipJMvozIxj,i
            YYhgmKivjkagHA,2DKr4H,S3F4exSFtj

            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas