|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
How do i get same data sting in a same tabe with diffrent id's
he guys
I have a problem, please help me.......... There is a table called delivery types in my database, and it contain delivery type and product id. Eg. productId Dilyvarytype 101 By Sea, By Air, By Currier 102 By Air, By Currier 102 By Air 103 Currier, By Air I need to do a SQL quarry and take common delivery methods related to all products EG. By Air How do I do this, is any body know how to quarry this? Thanks and regards ProDesigner. |
|
#2
|
|||
|
|||
|
Your database design, in my opinion, is messed up.
This is a many-to-many relationship, and you should then have 3 tables instead of 1. Product Table ============ ProductID ProductDescription etc... DeliveryType Table ============ DeliveryTypeID DeliveryTypeDescription etc... ProductDeliveryTypes Table ==================== ProductDeliveryTypeID ProductID DeliveryTypeID Then you should be able to query easier. |
|
#3
|
|||
|
|||
|
I agree that this should have been broken out into another table... but since it isn't you could do the following:
SELECT ProductID FROM [Table] WHERE DeliveryType LIKE '%AIR%' This will return all productID where the word "AIR" appears anywhere in the deliveryType field.... But, again, this is much less efficient than if you had them in a separate table. |
|
#4
|
|||
|
|||
|
t
thanks guys i got through the problem.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > How do i get same data sting in a same tabe with diffrent id's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|