Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's Wrong With This Syntax?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01082695
Message ID:
01082774
Views:
10
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform