Link to home
Start Free TrialLog in
Avatar of Member_2_5230414
Member_2_5230414

asked on

VB.NET -> sql select query

Hello,

I would like to select * from mysql table where Hometeam ="" or Awayteam=""

Then thing is I pull a list of matches that will be played each day so for instance today matches are:

23:20 Fortaleza V Ferroviario Fortaleza
22:30 Sao Paulo RS V Brasil de Pelotas
22:30 Rio Branco SP V Guaratingueta
22:30 Velo Clube V Ferroviaria
22:30 Sao Caetano V Mirassol
22:30 Itapirense V Osasco
22:00 Barbarense V Capivariano
21:45 Deportivo Anzoategui V Penarol
21:30 Ponte Preta V Ituano
21:30 Chapecoense V Hermann Aichinger
21:30 America MG V URT
21:00 Sociedad V Barcelona
21:00 Gremio Barueri V Santo Andre
20:00 Fulham V Liverpool
19:55 Nice V Monaco
19:45 Arsenal V Man Utd
19:45 Newcastle V Tottenham
19:45 Man City V Sunderland
19:45 Everton V C Palace
19:45 Stoke V Swansea
19:45 Sheff Utd V Brentford
19:45 Napoli V Roma
19:30 Hamburg V B Munich
19:00 Ourense V CD Alcala
18:45 Groningen V Twente
18:00 Hoffenheim V Wolfsburg
18:00 Leverkusen V Kaiserslautern
18:00 GAIS V Falkenbergs
18:00 Eskisehirspor V Sivasspor
18:00 Galatasaray V Antalyaspor
18:00 Bursaspor V Akhisar Belediye
18:00 Atromitos V Olympiakos
18:00 Real Union V SD Balmaseda FC
18:00 SC Wiedenbruck V FC Koln II
18:00 Netherlands (W) V Belgium (W)
18:00 Monte Azul V Guarani SP
18:00 Sao Jose EC SP V Catanduvense
17:45 Auxerre V Rennes
17:30 Supersport Utd V MP Black Aces
17:30 Platinum Stars V Bloemfontein Celtic
17:00 Hapoel Haifa V Hapoel Kiryat Shmona
16:00 Zaragoza B V CD Guadalajara
15:00 Dinamo Moscow V Dnipro
15:00 Olympiakos Volou V Panathinaikos
14:30 Arka Gdynia V Stomil Olsztyn
13:30 Ural V Rostov


how could i loop through to get each team name and place them in the Hometeam= "" and awayteam ="" ????
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Not sure I understand the problem. You have a list of match strings as shown in question and you want to split these into home town and away town? How would you identify that? Is the first team always the home team?
Avatar of Member_2_5230414
Member_2_5230414

ASKER

correct first team is always home....

In essence i would like to do something like this

select * from mysql table where Hometeam ="Stoke" or Awayteam="Stoke" or Hometeam ="Swansea" or Awayteam="Swansea" or Hometeam ="Sheff%Utd" or Awayteam="Sheff%Utd" or Hometeam ="Brentford" or Awayteam="Brentford" .......

Notice the % inbetween Sheff%Utd as where a space is i would like to search if its like  Sheff%Utd incase its listed as Sheffield Utd
ASKER CERTIFIED SOLUTION
Avatar of dustock
dustock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"Stoke" hmm. That brings back some memories :-)