bringing up a list

  • Supposing there are three Columns: Countries, Provinces and States.

    Then when the user enters “USA” for country, it will bring up a list of states, if they enter “Canada” for country, it will bring up a list of provinces, if they enter another country, it will not bring up any list?

    Do you know how to do it?

    Many thanks!

  • What you're describing is the behaviour of an application, not of a database.

    Databases don't work like that.

    I suggest that you search for a programming resource.

    -- Gianluca Sartori

  • Suppose @arg is the country application is requesting on user's behalf

    select case @arg when 'USA' then State when 'Canada' then Province end as [State or Province]

    from myTable

    where Country in ('USA', 'Canada' ) and Country = @arg

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply