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 |
|
shantanu88d
Starting Member
35 Posts |
Posted - 2011-05-02 : 07:01:09
|
| Hi I have 2 tables1. mobile_brands2. mobile_mastermaster table contains purchase entry of all mobiles in systm. first table is just a stand alone table having all brand namesi want to create a delete query which will delete a brand_name from mobile_brands only if that value does not exist in mobile_master table. How to go on about this query ??? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-05-02 : 07:04:20
|
delete mbfrom mobile_brands mbwhere not exists(select * from mobile_master mm where mm.brand_name = mb.brand_name) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-05-02 : 07:05:03
|
| DELETE FROM mobile_brandsWHERE brand_name NOT IN (SELECT brand_name FROM mobile_master)--------------------------http://connectsql.blogspot.com/ |
 |
|
|
|
|
|