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 |
|
indraja
Starting Member
6 Posts |
Posted - 2007-03-02 : 00:43:52
|
| I have a table with column as NAME. I want to show same field from database twice each with different conditions |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2007-03-02 : 00:53:18
|
| give us a little more info. How about typing out whatyou want it to look like. If you give us your table definition (DDL) we can even write the enitre query for you.-ec |
 |
|
|
indraja
Starting Member
6 Posts |
Posted - 2007-03-02 : 01:03:11
|
quote: Originally posted by eyechart give us a little more info. How about typing out whatyou want it to look like. If you give us your table definition (DDL) we can even write the enitre query for you.-ec
select the names starting with A in one column and starting with D in another column. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-02 : 01:17:19
|
| SELECT Name AS A, '_' + Name + '_' AS BFROM Table1Peter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-03-02 : 01:20:30
|
| [code]Selectcase when LEFT(name,1) = 'A' then name else '' end as Name1,case when LEFT(name,1) = 'D' then name else '' end as Name2From Tbl[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|