Creating table sql query for items(item id, item name , item description) RRS feed

  • Question

  • hey everyone plese help me in making this table of items i tried many times but its showing syntax error
    Saturday, May 20, 2017 10:18 PM

All replies

  • I notice that you have spaces in the column names.  Object names which include spaces or other special characters must be enclosed in square brackets, e.g.

    SELECT [item id], [item name], [item description]
    FROM Items
    ORDER BY [item name];

    It is better not to use spaces in object names, however, but to use CamelCase, e.g.

    SELECT ItemId, ItemName, ItemDescription
    FROM Items
    ORDER BY ItemName;

    or to represent spaces by underscore characters:

    SELECT item_id, item_name, item_description
    FROM Items
    ORDER BY item_name;

    Ken Sheridan, Stafford, England

    • Proposed as answer by Chenchen Li Monday, May 22, 2017 1:21 AM
    Saturday, May 20, 2017 10:42 PM