- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					SQL query..
				
					
						
							Hi
 I have a question regarding to sql query. Can any one do this.?
 
 We have two tables tableA and tableB, In tableA there is 20,000 records and in tableB 8000 records present. All records in tableB are duplicate, i have a field "ipd_prod" that is either "bulk" or "prduct name" i want to check only "product name" . Some records of tableB is also present in tableA.
 
 "I want to fetch that records which is not in tableB and `ipd_prod` <> (not )  "bulk" ." ?
 
 what is the sql_query I write for that particular records.
  
 
 Thanks and Regards
 Praful.
 
 
 
 
 
 
 
 
 
- 
	
	
		
			
			
				Expert Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					Re: SQL query..
				
					
						
							Dear Praful,
 Try this query
 SELECT  fields from tablea
 WHERE   ipd_prod not in ( select distinct ipd_prod from table b )
 AND ipd_prod <> 'bulk'
 
 Regards
 Krishna
 
 
 
 
 
 
				
				
				
					
						Last edited by krishnaindia2007; 02-14-2008 at 05:06 AM.
					
					
				 
 
 
 
 
- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						  
 
					    
				 
 
			
				
				
				
					Re: SQL query..
				
					
						
							SELECT fields from tablea
 WHERE ipd_prod not in ( select distinct ipd_prod from table b )
 AND ipd_prod <> 'bulk'
 
 this will print all data which is in tableB and not in tableA
 
 I just replace tableA as tableB and tableB as tableA then it will so the data I required.
 
 thanks for your suggetion
 
 
 
 
 
 
 
 
 
 
	
	
	
	
	
	
	
	
	
	
	
	
		
		
			
				 Posting Permissions
				Posting Permissions
			
			
				
	
		- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-  
Forum Rules