|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help for stored procedure.
Hi All,
I have two tables 1) bedType table bedTypeID, bedType --- 1 , king 2, queen 3 , single 4 , double --- 2) room_bedType table( this is junction table between bedType and room table) roomID, bedTypeID --- 3 , 1 3, 2 4 , 2 4 , 3 --- I need to make a following stored procedure Select all bedType from bedType table, but not those are in second table room_bedType and roomID is equal to 3 Any idea how to do this. Thanks in advance for your help Rainbow11 |
|
#2
|
||||
|
||||
|
Something like this?
Code:
Create Procedure stp_GetBedType @RoomID As int AS SELECT * FROM BedType WHERE BedTypeID NOT IN ( SELECT DISTINCT BedTypeID FROM Room_BedType WHERE RoomID = @RoomID ) Last edited by Memnoch : November 21st, 2004 at 04:20 PM. |
|
#3
|
|||
|
|||
|
Quote:
thanks again for your time and reply. rainbow11 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Need help for stored procedure. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|