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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL MINUS AND COUNT DATA

Author  Topic 

ledwallet
Starting Member

3 Posts

Posted - 2008-01-11 : 12:54:05
Hi again :)

i have a tableA with 5 fields, all text format: data_event, sin, ass, tarass, ctr, tarctr; sin field is unique no duplicate value.

I need to know a lot of combination for extrat records as:

1)data_event and ass and tarass and ctr and tarctr
==>field sin not needs in the combination;in this i know how many record are with the same value and it's ok.

but for next combinations how can i do that without refind records that i extract before with those combi:

2)data_event and ass and tarass and ctr
3)data_event and ass and tarass
4)data_event and ass
5)data_event and tarass
6)data_event and ctr
7)data_event and tarctr

My problem is that i need to don't repeat records, any combi i have to delete or put out those records.

i use Sql server 2005 and this from http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm


"
MINUS operator Not supported

Use NOT EXISTS clause in your SELECT statement to generate the same result.

The following example illustrates the simulation of Oracle's MINUS operator:

SELECT OrderID, OrderDate
FROM Orders O
WHERE NOT EXISTS
(
SELECT 1
FROM RefundsTable R
WHERE O.OrderID = R.OrderID
)
"

Thks a lot in advance.
   

- Advertisement -