Jump to content

khadar

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by khadar

  1. Use IN instead of an equal sign. You don't want to check if a value in a column is equal to an entire result set, you want to see if the value of the column is in that result set.I'm sure it's correct, trust the database. I'm sure you have multiple records in order_details that match something in order.

    You are right, there are multiple records in that select statement. I used IN instead of WHERE, and its working.. Thanks.

  2. I want to perform a join on three tables.Table 1: part_masterColumn: Item, Item_statusTable 2: Order_DetailsColumn: Item, order_num, order_typeTable 3: OrderColumn: order_num, order_typeHere is the cardinality:part_master <--> order_details (1..1)order <--> order_details (1..n)I want to perform a search on order table, to retrieve item_status from part_master. In other word, I want to see item_status, for an order, using order_num as a search criteria.I tries something like this, however, it throws a exception:select part_master.item_status from part_master where item = (select item from order_details where order_details.order_num = order.order_num)The error says, the second 'select' statement returns multiple results which is not correct..Help....!

×
×
  • Create New...