mysql - How To Manage Unique and Non-Unique Data At Once -


lets take example:

there 3 data: d1,d2 , d3 d1 country d2 state d3 city

i need activity city using state. in case of multiple states, 2 situation comes in front of me. 1) if state 1 has done activity city1, state 2 should not go it. achieve this, used country , city unique constrants there activity done 1 city state in country1 (there no problem if data gets repeated in country2). when application fetch data country1, store each city respective city. country , city unique, , @ time of doing activity search select * table state = "xx" , status = "unprocessed" , country = "country1"

it returns list of cities, no activity has been done. activity, since there no duplicate entries of cities country1, processing unique city different states.

2) in case, want activity should done each city every state. state1 should perform activity on city1, state2 should perform activity on city1. now, since have country , cities unique constrants, never able values "country1,state1,city1", "country1,state2,city1)","(country1,state3,city1)". desktop application, build using dotnet, can achieve of dictionary, match records available processed, record has processed states. going have millions of data, , going consume time then, making software work slow. want handle using database itself, using value in columns or kind of status. notsure.

please help


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -