Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 1,216 total)

  • RE: help with a query

    Well, the problem seems to be that we don't know for sure how many columns there will be. Do YOU know that? If not, then you can't do it in...

  • RE: SQL Stumper

    Hello,

    I'm not sure I understood fully your requirement, but here goes... this will produce the same result as you posted, based on supplied data.

    SELECT TradeDate, Symbol, OpenPrice, PercentChange

    FROM EODDetail eod

    WHERE...

  • RE: Primary Key vs IDENTITY Property ????

    Here is just one example how IDENTITY does not guarantee uniqueness:

    CREATE TABLE #t(a int IDENTITY, b varchar(5))

    INSERT INTO #t VALUES ('ss')

    INSERT INTO #t VALUES ('ab')

    SET IDENTITY_INSERT #t ON

    INSERT INTO #t (a,b) VALUES (1,...

  • RE: SELECT ALL FIELDS , best method ??

    Now, that's interesting, Farrell... I always assumed that there is no need to use TOP 1 in EXISTS clause, since the EXISTS itself requires only 1 matching record to return...

  • RE: Need to append a character onto end of data in a column

    Since the column is rather short (NVARCHAR(32)), I would suggest adding a length check to avoid problems when trying to add another character to entry that already is at maximum...

  • RE: date type error?

    Operator (probably "AND") is missing in one of the WHERE clauses between the two conditions for date:

     tt.type='PR' and

      tp.time>'01/13/04'

      tp.time<'05/15/04'

     group by pr.name

  • RE: Complex query?

    Just what does it mean "by date"? In case you need to find out what the totals were at a certain date, then it shouldn't be too complicated. BTW, you...

  • RE: SQL Newb Needs some help. (If ya''''ll can''''t help me that''''s cool)

    Well, I would probably prefer a self-join over the existence check... EXISTS is rather self-explaining, while here you need comments to make sure other people will quickly understand your code......

  • RE: combining rows

    Question is, can you guarantee, that every column will always have non-NULL value in one row with a given ID? The sample of data looks like that, but is it...

  • RE: SELECT ALL FIELDS , best method ??

    Well, if you just want to send an alert if the view returns something, why not use this as a condition:

    IF EXISTS (SELECT * FROM [vwDups])

    That is, if you don't...

  • RE: Adjust Field Queried automatically

    IMHO you are asking for big trouble this way, sooner or later - probably rather soon.. If you are at it, you might as well make a table called Current_month and at the end...

  • RE: Update query

    Right, I overlooked in your original post, that the column contains both numbers AND letters. If it is always so that the first 3 characters are numbers and the fourth...

  • RE: Update query

    What the code does is, that it calculates remainder of division of the number by 2. If remainder  = 0, then it takes the first character. If remainder is 1,...

  • RE: Update query

    joe,

    please don't be confused by my joke at EU, what I said about David's code being nice was meant in earnest. It is the best solution, because it does the...

  • RE: Update query

    Wow, that with substring looks nice :-). You even managed to get something about European Union into it... is this following some new Euro-SQL directives from Brussels?

Viewing 15 posts - 1,006 through 1,020 (of 1,216 total)