User Profile
Collapse
Profile Sidebar
Collapse
Ann VK
Last Activity: Oct 1 '12, 04:21 PM
Joined: Feb 1 '12
Location:
-
Thanks for the response. This worked.... -
I will have C and D as Agency. THe user is not worried about that. Only the A and B can be like duplicate records which they dont want to see together for the same IDs.Leave a comment:
-
I am really sorry i was plannign to put the example of how i want hte putput to be but i forgot. Her eis how the output should be:
ID Agency Value
1 A 1000
1 C 3000
2 A 1100
2 C 3100
3 B 2200
3 C 3200
So in short if for an ID both Agency A and B are present then i want only IDs that have Agency = A. But in case if the IDs has only Agency B then i want that records. Hoep this make sense....Leave a comment:
-
Exclude Records from a table based on a condition
Can someone help me to figure out a query for this requirement? I have a table with the follwoign columns:
ID Agency Value
1 A 1000
1 B 2000
1 C 3000
2 A 1100
2 C 3100
3 B 2200
3 C 3200
Now i want to be able to retrieve so that if for an ID the Agency A and B are pr esent then i want to take the row of A else if onyl A is... -
Thanks you so much for your suggestion. I tried this way and it worked!!
Just in case someone wants to see the query, i created a view for this with query:
with cte_rownum (Ranks,ID,End_D ate,Price) as
(select rank() over (order by ID,End_Date) as rank,
ID,End_Date,Pri ce from PriceTable)
select a.* from cte_rownum a inner join cte_rownum b on a.ranks = 1 where a.Price <> b.Price...Leave a comment:
-
SQL Query to display records that dont match in consecutive rows
I have a table with records like:
ID End Price
A 20060625 5.7025000000000 0000000
A 20060725 5.7650000000000 0000000
A 20060825 5.7043800000000 0000000
A 20060925 5.7100000000000 0000000
A 20061025 5.7000000000000 0000000
A 20061125 5.7000000000000 0000000
A 20061225 5.7300000000000 0000000
A 20070125 5.7000000000000 0000000
I want to get a query which would give the result...
No activity results to display
Show More
Leave a comment: