Viewing 15 posts - 1 through 15 (of 78 total)
Sample Data
CREATE TABLE ENCOUNTER_PARTY( ENCOUNTER_KEY INT, PARTY_KEY INT, PARTY_ROLE_TYPE_KEY INT)
INSERT INTO ENCOUNTER_PARTY
SELECT '3','13855','2' UNION ALL
SELECT '3','103192','13' UNION ALL
SELECT '3','110986','3' UNION ALL
SELECT '4','103192','13' UNION ALL
SELECT '4','112112','3' UNION ALL
SELECT '6','13855','2' UNION ALL
SELECT...
June 25, 2012 at 3:20 am
I cant use where clause directly because if will say
SELECT * FROM ENCOUNTER_PARTY WHERE PARTY_ROLE_TYPE_KEY NOT IN (2)
It will give me all the rows but except with PARTY_ROLE_TYPE_KEY NOT =...
June 25, 2012 at 2:52 am
Expected output is 101 and 103 because those encounters dont have party_role_type_key = 2
But how to select with query?
June 25, 2012 at 2:49 am
Bit change in sample data.
CREATE TABLE ENCOUNTER_PARTY( ENCOUNTER_KEY INT, PARTY_KEY INT, PARTY_ROLE_TYPE_KEY INT)
INSERT INTO ENCOUNTER_PARTY
SELECT 101, 11, 3 UNION ALL
SELECT 101, 12, 13 UNION ALL
SELECT 101, 13, 4 UNION ALL
SELECT...
June 25, 2012 at 2:46 am
Try this -
CREATE TABLE #Temp ( state varchar(10), amt money, per varchar(10) )
INSERT INTO #Temp
SELECT 'NSW','130','person1'
UNION ALL
SELECT 'QLD','100','person1'
UNION ALL
SELECT 'NSW','120','person2'
UNION ALL
SELECT 'QLD','200','person2'
UNION ALL
SELECT 'NSW','110','person3'
UNION ALL
SELECT 'QLD','300','person3'
SELECT a.State, a.TotAmt, b.Per FROM...
July 3, 2010 at 4:54 am
try this -
SELECT L.ClientID, S.LocationID, S.ServiceID, COUNT(D.ServiceID) numTrips, SUM(numHours) totalnumHours FROM @Location L INNER JOIN @Service S ON L.LocationID = S.LocationID
INNER JOIN @ServiceDates D ON S.ServiceID = D.ServiceID
GROUP BY...
July 3, 2010 at 2:50 am
We can do it but that will not standard and even it will not achieve great level of correctness.
as we can find out table names in procedure script with sql...
April 23, 2010 at 2:23 am
Except if sdate includes a time, in which case dates such as '16/04/2010 12:23:21' will not be returned
I am not getting please explain...
April 17, 2010 at 7:35 am
This is the only option if you dont want to use enterprise manager
-- creating the new table with the structure required
CREATE TABLE Emp_temp(
emp_num INT NOT NULL PRIMARY KEY,
first_name CHAR(30) NOT...
April 17, 2010 at 6:00 am
mister.magoo (4/16/2010)
You need to convert your reference date, which are...
April 17, 2010 at 5:38 am
gaurav-404321 (4/17/2010)
DELETE FROM sectionnumeric
FROM dbo.CreateSectionTableFromString(placementcandidatelanguageproficiency,placementcandidatetrainingsinternshipsprojects,placementcandidatequalificationdetails)
This query is giving lot of errors. I think some syntax mistake...
April 17, 2010 at 4:42 am
You can use like this
Even You can pass the value xxx and yyy as a parameter
to make it more generalize.
DECLARE @SQL AS VARCHAR(MAX)
DECLARE @ColumnToUpdate nvarchar(max)
DECLARE@ColumnSelected nvarchar(max)
SELECT@ColumnToUpdate = 'Var1',
@ColumnSelected...
April 17, 2010 at 4:32 am
Viewing 15 posts - 1 through 15 (of 78 total)