Click here to Skip to main content
14,269,003 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have two columns..


ClientCode Address
A002 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Hyderabad|500001|Andhra|INDIA
A002 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Mumbai|400001|Maharashtra|INDIA
C001 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Bangalore|400001|karnataka|INDIA
C002 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Pune|400001|Maharashtra|INDIA
D002 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Anantapur|400001|Andhra|INDIA
D002 RAHIM APARTMNET,GULZAR LANE,NEAR PETROL PUMP|Chennai|400001|TamilNadu|INDIA

i want to fetch ClientCode based on City....please help me out...
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

your query will be like that....

select ClientCode from TableName where Address like 'here your search parameter'

e.g

select ClientCode from TableName where Address like 'Mumbai'

OR

select ClientCode from TableName where Address like '%here your search parameter'

OR

select ClientCode from TableName where Address like '%here your search parameter%'
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 3

Your table is not correctly defined. You have to split the address field into some separate fileds, like city, post code, province, road, etc.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100