Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's Wrong With This Syntax?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01082695
Message ID:
01082774
Vues:
11
Why don't you use JOIN?
...
  JOIN Station st ON st.id = doc.station
        AND st.Station_Name = 'whatever'
...
>Ok, here's a follow on question.
>
>This SQL does not have a WHERE clause. The clause will be built dynamically
>based on user pref's.
>
>Since the station is in a separate table, it seems like I'll have to
>query the station table for the Id:
>
>
>SELECT Id
> FROM Station;
> WHERE Station_Name = PADR(ThisForm.txtStation.Value, 20, " ")
>
>
>
>Then use the Id returned in my other query as part of the WHERE clause:
>
>
> cWhere  = cWhere  + " and st.Id = '" + TRANSFORM(nStationId) + "'"
>
>
>I'm not entirely sure of the right way to do this in SQL. Does not sound ok?
>
>Thanks
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform