Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012
    Posts
    6

    Unanswered: help with my view

    Write a CREATE VIEW statement that defines a view named InvoiceBasic that returns three columns: VendorName, InvoiceNumber, and InvoiceTotal. Then, write a SELECT statement that returns all of the columns in the view, sorted by VendorName, where the first letter of the vendor name is N, O, or P.

    This is what I have so far,

    CREATE VIEW InvoiceBasic AS
    SELECT VendorName, InvoiceNumber, InvoiceTotal
    From Vendors JOIN Invoices
    ON Vendors.VendorID = Invoices.VendorID


    Go
    SELECT *
    From InvoiceBasic

    Where
    Order by VendorName

    I am using sql 2008
    Last edited by joshp; 07-24-12 at 19:38.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
       WHERE  VendorName LIKE '[NOP]%'
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jul 2012
    Posts
    6
    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •