December 18, 2012 at 1:51 pm
I would like to explain my problem with a simple example.
Here is a part of my database:
Type Service
----- -----
Freshwater Habitat
Saltwater Food
Dunes Recreation
That's the query I have: (It's HQL which is similar to T-SQL)
from Gecoserv _a where _a.typeOfEcosystem IN (:typeNameList) AND _a.service IN (:serviceNameList)
I want the grid to show only the single combinations (Freshwater-Habitat, Saltwater-Food and Dunes-Recreation etc.) but it shows also other combinations (ex: Freshwater-Recreation).
How can I fix my problem ?
December 18, 2012 at 1:57 pm
Hi and welcome to SSC. It is pretty difficult to provide a detailed answer for your question without speculating quite a few things. You might want to take a quick look at the first link in my signature for best practices when posting questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 18, 2012 at 11:10 pm
mozturk 92000 (12/18/2012)
(It's HQL which is similar to T-SQL)How can I fix my problem ?
Write it as a stored procedure in T-SQL instead of relying on HQL. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2012 at 8:42 am
T-SQL :
Select * from Gecoserv where typeOfEcosystem IN (:typeNameList) AND service IN (:serviceNameList)
December 21, 2012 at 7:45 am
mozturk 92000 (12/20/2012)
T-SQL :Select * from Gecoserv where typeOfEcosystem IN (:typeNameList) AND service IN (:serviceNameList)
That is the same thing you posted originally. It seems you want some help with the code. I am willing to help but you have to provide me with something to work with. ddl, sample data and desired output. As I said before you find details about best practices for posting questions by clicking the first link in my signature. I am certain that if you post the necessary information you will have an answer very quickly.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply