Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dlmagers10
Starting Member
48 Posts |
Posted - 2010-10-18 : 23:35:14
|
| COULD IT BE......SELECT ORDER_NUM, ORDER_DATEFROM ORDERSWHERE EXISTS(SELECT *FROM ORDER_LINEWHERE ORDERS.ORDER_NUM = ORDER_LINE.ORDER_NUMAND PART_NUM = 'DR93')(SELECT *FROM CUSTOMERWHERE CUSTOMER.CUSTOMER_NUM = ORDERS.CUSTOMER_NUMAND CUSTOMER_NUM ='608');('608' IS THE CUSTOMER_NUM FOR JOHNSON DEPARTMENT STORE)WHEN I MAKE MY SELECT STATEMENT IN MICROSOFT SQL SERVER SOFTWARE IT COMES UP AS AN ERROR STATINGquote:--------------------------------------------------------------------------------Msg 4104, Level 16, State 1, Line 10The multi-part identifier "ORDERS.CUSTOMER_NUM" could not be bound.--------------------------------------------------------------------------------TABLES INCLUDED:ORDERS ~ORDER_NUM, ORDER_DATE, CUSTOMER_NUMORDER_LINE ~ ORDER_NUM, PART_NUM, NUM_ORDERED, QUOTED_PRICEPART ~ PART_NUM, DESCRIPTION, ON_HAND, CLASS, WAREHOUSE, PRICECUSTOMER ~ CUSTOMER_NUM, CUSTOMER_NAME, STREET, CITY, STATE, ZIP, BALANCE, CREDIT_LIMIT, REP_NUMONLY LOOKING FOR DIRECTION NOT LOOKING FOR SOMEONE TO GIVE ME THE ANSWER. I NEED TO ANSWER ON MY OWN. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-19 : 00:45:41
|
| You have a table alias wrongly defined for the second query with the exists clause.Hint-You need to put an and clause for the second exists query.PBUH |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-19 : 02:48:27
|
quote: Originally posted by dlmagers10 COULD IT BE......SELECT ORDER_NUM, ORDER_DATEFROM ORDERSWHERE EXISTS(SELECT *FROM ORDER_LINEWHERE ORDERS.ORDER_NUM = ORDER_LINE.ORDER_NUMAND PART_NUM = 'DR93')AND EXISTS(SELECT *FROM CUSTOMERWHERE CUSTOMER.CUSTOMER_NUM = ORDERS.CUSTOMER_NUMAND CUSTOMER_NUM ='608');
Try this and come back if there are any errors. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-19 : 02:50:49
|
quote: Originally posted by webfred
quote: Originally posted by dlmagers10 COULD IT BE......SELECT ORDER_NUM, ORDER_DATEFROM ORDERSWHERE EXISTS(SELECT *FROM ORDER_LINEWHERE ORDERS.ORDER_NUM = ORDER_LINE.ORDER_NUMAND PART_NUM = 'DR93')AND EXISTS(SELECT *FROM CUSTOMERWHERE CUSTOMER.CUSTOMER_NUM = ORDERS.CUSTOMER_NUMAND CUSTOMER_NUM ='608');
Try this and come back if there are any errors. No, you're never too old to Yak'n'Roll if you're too young to die.
quote: ONLY LOOKING FOR DIRECTION NOT LOOKING FOR SOMEONE TO GIVE ME THE ANSWER. I NEED TO ANSWER ON MY OWN.
OP was looking for DIRECTION and not for the ANSWER PBUH |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-19 : 02:54:23
|
quote: Originally posted by Sachin.NandOP was looking for DIRECTION and not for the ANSWER PBUH
Oh, I am sorry  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|