Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2014

    Unanswered: create view query with many select statement.

    what I mean is a query like this...

    create view monthly AS
    select distinct description from item order by description
    select sum(quantity-loses) from inventory join item on item.item_id = inventory.item_id where month(date) < month(now())
    select sum(quantity-loses) from transaction join item on item.item_id = transaction.item_id where month(date) < month(now());

    I already tried to use subqueries but when querying the inventory and transaction table it gives an error "returns more than one row" for they dont have the same where statement.

    I tried also union but still no luck.

    somebody help pls. tnx.

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 12
    What result are you looking for?
    If it is three separate resultsets then perhaps a stored procedure is more appropriate.
    Home | Blog

Tags for this Thread

Posting Permissions

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