User Profile

Collapse

Profile Sidebar

Collapse
shenliang1985
shenliang1985
Last Activity: Oct 7 '08, 09:03 AM
Joined: Nov 24 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Code:
    select startdate from fortest;
    --startdate is a datetime type
    --the following are startdate's records in  table fortest
    startdate
    2008-08-08 12:12:12.000
    2008-08-21 21:21:21.000
    2006-07-07 00:00:00.000
    2009-09-09 00:00:00.000
    2008-08-08 12:12:12.000
    
    select startdate from fortest where startdate <'2009-09-09 10:00:00.000' and startdate>'2006-07-07 00:00:00.000'
    ...
    See more | Go to post

    Leave a comment:


  • shenliang1985
    replied to About join
    I found the answer myself
    Use :


    select a.a ,b.* from testfulljoin2 as b left join testfulljoin as a on a.b=b.b and a.c=b.c;
    See more | Go to post

    Leave a comment:


  • shenliang1985
    started a topic About join

    About join

    I have Created two tables to test join key in sql server,but the result is
    not what I thougt.Why?Wish all your explains.Thanks .I give all the sql code
    in comment.
    --The table name is first for tesing fulljoin
    /*
    create table testfulljoin
    (a char(4),
    b char(4),
    c char(4))
    insert testfulljoin(a, b,c)
    select 'a','b','c' union all
    select 'b','a','d' union all
    select 'c','d','e'...
    See more | Go to post
No activity results to display
Show More
Working...