Forum Replies Created

Viewing 15 posts - 1 through 15 (of 22 total)

  • RE: The Pitfall of "Not Equal To" Operator in Queries!

    The best way to think about it as "NOT EXISTS". This is the most logical human approach. You can always convert "not exists" into "left join"

     select s.* from #students s

    where...

  • RE: Pro SQL Server 2005

    I enjoyed reading it. My company will switch to SQL 2005 directly from SQL 7 within a couple of month and I am trying to read as much as possible about CLR...

  • RE: Exporting to Text File

    this might help you.

    http://www.motobit.com/tips/detpg_SQLWrFile/

     

    I used this approach before and it worked well. I used cursor to loop through the result query, to format and write it into text file...

  • RE: Deleting Duplicate Records

    set nocount on

    /* Script for Creation of Employee Table*/

    CREATE TABLE [dbo].[#Employee] (

                [id] [int] NULL ,

                [name] [Varchar] (50)  NULL ,

                [salary] [Numeric](18, 2) NULL

    &nbsp

  • RE: Deleting Duplicate Records

    Would it be just easier to save duplicated records in temp table where we have only 1 records for all duplicated records, then to delete all duplicated records in one shot from the original...

  • RE: WHERE IN(sub-query) vs. INNER JOIN

    Besides performance issues, I think that typical beginners usually prefers WHERE IN or WHERE NOT IN to include or exclude something, because this logic is kind of easier to...

  • RE: WHERE IN(sub-query) vs. INNER JOIN

    you should always try to use simple JOIN over WHERE IN , if it is possible.

    The same goes for LEFT JOIN over Where NOT IN

  • RE: Good Book for SQL Developer

    I really like this book.

    http://www.bookpool.com/.x/3b9ypa4by8/sm/1893115828

    Pretty good book for the programmers who want to move toward more advanced stuff

  • RE: Correlated SubQuery

    That how aggregate function works with Group by. It aggregates all records based on your grouping. Based on your query you want to count events for the entire day and...

  • RE: HELP :: Operation must use an updateable query.

    Try to delete and rebuild this link from scratch, do not just refresh. 

    MS Access will ask you about unique key, make sure you select unique key. Good luck!

  • RE: Correlated SubQuery

    this part of your query  I do not understand, it does not look that you need it at all

    AND A.OpenedDateTime = (SELECT MAX(OpenedDateTime)

  • RE: Correlated SubQuery

    It maybe because you group by A.OpenedDateTime and it has to be just date without time part

    should be something like

    SELECT A.UserID, A.CategoryDescript, A.ComplaintType, convert(varchar(10),A.OpenedDateTime,101), COUNT(A.ComplaintID) AS OpenedTot

    FROM vwComplaintDetails A

    WHERE A.OpenedDateTime...

  • RE: Either Easy or Tough Join

    Update TableA  

    Set TableA.Flag = 'Y'

    from

     tableA

                left join

      tableB on tableA.key1 = tableB.key1 and tableA.key2=tableB.key2 and tableB.FLd ='0'

    where tableB.key1 is null and tableB.key2 is null

  • RE: Retriving host IP Address via T-SQL

    host_name() will return workstation IP address, the computer that calls this code. In order to get server IP, you should stick to ipconfig

  • RE: Sorting with Varchar Field

    sorry, I did not read the entire thread.

    Obviously, using patterns is much shorter and prettier

     

    select 'RKA10' as Data into #data from sysobjects where 1=2

    union

    select 'RKA100'

    union

    select 'KA11'

    union

    select 'RMX10'

    union

    select 'RMX100'

    union

    select 'RMX11'

    union

    select 'RSA12'

    union

    select...

Viewing 15 posts - 1 through 15 (of 22 total)