Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Database Administration

forums forums SQLyog Query Builder and Schema Designer Database Administration

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #31583
      peterlaursen
      Participant

      Well .. then te query returns an empty set  (no rows satisfies the condition).

      Take an analytical approach .. simplify.  Do these queries return what you'd expect?

      1)

      SELECT COUNT(ON_HAND)

      FROM INVENTORY

      WHERE INVENTORY.ON_HAND > '25';

      2)

      SELECT BRANCH.BRANCH_NUM, INVENTORY.ON_HAND

      FROM INVENTORY, BRANCH

      WHERE BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM';

      If somebody should be able to help you you will need to post an exact case with table definitions and sample data.

    • #31584
      Diana Magers
      Member
      'peterlaursen' wrote:

      Well .. then te query returns an empty set  (no rows satisfies the condition).

      Take an analytical approach .. simplify.  Do these queries return what you'd expect?

      1)

      SELECT COUNT(ON_HAND)

      FROM INVENTORY

      WHERE INVENTORY.ON_HAND > '25';

      2)

      SELECT BRANCH.BRANCH_NUM, INVENTORY.ON_HAND

      FROM INVENTORY, BRANCH

      WHERE BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM';

      If somebody should be able to help you you will need to post an exact case with table definitions and sample data.

      Actually it came out to be:

      SELECT BRANCH.BRANCH_NUM, SUM(INVENTORY.ON_HAND) as UnitsOnHand

      FROM BRANCH JOIN INVENTORY

      ON BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM

      GROUP BY BRANCH.BRANCH_NUM

      HAVING SUM(INVENTORY.ON_HAND)>25

    • #31585
      Diana Magers
      Member
      'peterlaursen' wrote:

      Well .. then te query returns an empty set  (no rows satisfies the condition).

      Take an analytical approach .. simplify.  Do these queries return what you'd expect?

      1)

      SELECT COUNT(ON_HAND)

      FROM INVENTORY

      WHERE INVENTORY.ON_HAND > '25';

      2)

      SELECT BRANCH.BRANCH_NUM, INVENTORY.ON_HAND

      FROM INVENTORY, BRANCH

      WHERE BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM';

      If somebody should be able to help you you will need to post an exact case with table definitions and sample data.

      Actually it came out to be:

      SELECT BRANCH.BRANCH_NUM, SUM(INVENTORY.ON_HAND) as UnitsOnHand

      FROM BRANCH JOIN INVENTORY

      ON BRANCH.BRANCH_NUM = INVENTORY.BRANCH_NUM

      GROUP BY BRANCH.BRANCH_NUM

      HAVING SUM(INVENTORY.ON_HAND)>25

Viewing 2 reply threads
  • You must be logged in to reply to this topic.