Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2011-10-26 : 09:48:19
|
| table t1select distinct ["a"] from t1i got"a""01""02""03"Strange every thing has "" on it.I tried to run select distinct ["a"] from t1where ["a"]='01'I get no record return.How can I make it return "01"?Thanks. |
|
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2011-10-26 : 09:51:06
|
| I also need to join table t2 select distinct a from t2will returna0102select t1.*from t1, t2on t1.["a"]=t2.aHow to make it work? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-26 : 13:50:05
|
quote: Originally posted by jeff06 table t1select distinct ["a"] from t1i got"a""01""02""03"Strange every thing has "" on it.I tried to run select distinct ["a"] from t1where ["a"]='01'I get no record return.How can I make it return "01"?Thanks.
select distinct ["a"] from t1where ["a"]='"01"' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-26 : 13:52:26
|
quote: Originally posted by jeff06 I also need to join table t2 select distinct a from t2will returna0102select t1.*from t1, t2on t1.["a"]=t2.aHow to make it work?
select t1.*from t1join t2on t1.["a"]='"' + t2.a + '"' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|