Forum Replies Created

Viewing 15 posts - 46 through 60 (of 1,082 total)

  • RE: Brain lock on determine if char or not

    The like statement will not work if the statement is less that 9 chars.

    what you want to do is search for a non-numeric char starting from the 3 char in...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Brain lock on determine if char or not

    I still wouldn't use is numeric as "." is also included in the check for example 10.10 would be numeric.

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to convert rows to columns?

    me too 🙂

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to convert rows to columns?

    Here is a solution that will work for Multiple Image types:

    CREATE TABLE MyTable

    (Id INT,

    CustomerId INT,

    ImageName VARCHAR(100))

    INSERT INTO MyTable

    SELECT 1,123,'123_X.jpg' UNION ALL

    SELECT 2,123,'123_Y.jpg' UNION ALL

    SELECT 3,456,'456_X.jpg' UNION ALL

    SELECT 4,456,'456_Y.jpg'...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: I got an answer of 4 for the above, was expecting that it would be 1.

    the variable be assigned the value of every row, so the last row return is what the variable will be.

    Because a table has no Order and you not using an...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: I got an answer of 4 for the above, was expecting that it would be 1.

    Why would you expect 1?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to convert rows to columns?

    have you looked up Pivot/cross-tab queries?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: How to convert rows to columns?

    Have you tried searching around here for Pivot and or Cross-tab queries?

    If you can't find anything let me know.

    Also please answer the question above as this will determine weather it...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Help with query

    try this:

    ;WITH CTE as (

    select

    ROW_NUMBER() OVER(PARTITION BY Item,price1,price2 ORDER BY Date DESC) Row,

    *

    from #temp

    )

    SELECT *

    FROM CTE

    WHERE ROW = 1

    order by date

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Basic SQL Programming Question - Joining 3 tables then sorting

    try this:

    SELECT

    Category,

    COUNT(*)

    FROM

    (SELECT

    CASE WHEN salary between 0 and 10000 then 'range = 20000 and salary = 30000 and salary = 40000 and salary = 50000 and salary =...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Basic SQL Programming Question - Joining 3 tables then sorting

    could you supply some the definition of your table and some sample data with the expect output.

    It's pretty hard to write a query for a desired output if you dont'...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: NULL and Unique IDentifier.. :-(

    The Records are inserted in the same order.

    AS you can see by the ID values assigned.

    I think you mean that rows are returned in a order that you are...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: pivot or cross tab assistance

    Taking the CTE and test data from Imu92 here is a dynamic solution

    CREATE table t (CIF char(4), ACCTNO int, SSNO varchar(10), CODE int)

    insert into...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: pivot or cross tab assistance

    Have you tried making it dynamic?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: pivot or cross tab assistance

    will your output always only have code and code1

    or is it possible to have:

    code code1 code2 code3 etc?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 46 through 60 (of 1,082 total)