Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query Help

Author  Topic 

Jimmy1981
Starting Member

8 Posts

Posted - 2011-12-29 : 07:57:57
Hi,

I am new to SQL queries and was after some help.

I have a database with fields ID, Line, StationName, StationNumber and Variant.

I need to:
Find the line and station from the database (from selections made from user)
This will show what variants the station has attached to it.

I then need to use these variants to search the database against the Line to show all StationNames with the same Variant and Line

Seems simple but I'm not sure how i'd start, would I need multiple queries?

Also, this query will return duplicate stationnames which is expected but is there a way of having the query show no duplicates?

Thanks,
Jimmy

X002548
Not Just a Number

15586 Posts

Posted - 2011-12-29 : 09:04:54
Jim,

There is no method (other than what you may have implemented) to see what a User has SELECTed

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

Jimmy1981
Starting Member

8 Posts

Posted - 2011-12-29 : 09:18:45
what about how it would be done if the line was TEST and station was TEST2, say we ignore how to determine what they select?

I will be able to sort that bit using VB.Net
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-12-29 : 09:21:45
read the hint link in my sig...I am not following what you want

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -