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 |
|
rahulmsccs
Starting Member
2 Posts |
Posted - 2005-06-17 : 03:34:13
|
| Hello Everyone,Please get me the solution for the problem specified below:Consider a table >Column Name A B 23 g 26 m 23 h 55 a 26 k 23 sI have to come up with a SQL query which can provide me with the output > 23 g, h, s 26 m, k 55 aRegards,Rahul |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
rahulmsccs
Starting Member
2 Posts |
Posted - 2005-06-17 : 05:29:51
|
| hey man ... thanx for the reply !that was a good option.... but i hv' a small problem ! the page refers to a query >DECLARE @EmployeeList varchar(100)SELECT @EmployeeList = COALESCE(@EmployeeList + ', ', '') + CAST(Emp_UniqueID AS varchar(5))FROM SalesCallsEmployeesWHERE SalCal_UniqueID = 1SELECT @EmployeeListThis query declares a variable - @EmployeeListI want to code in Java so can't declare the variable. Also, I'm not allowed to implement this through stored procedure. Can you suggest any solution for this ?it wud b gr8 help ! |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-06-17 : 06:52:41
|
why can't you???sSqlStmt = "DECLARE @EmployeeList varchar(100); SELECT @EmployeeList = COALESCE(@EmployeeList + ', ', '') + CAST(Emp_UniqueID AS varchar(5))FROM SalesCallsEmployeesWHERE SalCal_UniqueID = 1;SELECT @EmployeeList"and then you execute that sSqlStmt with your JDBC or whatever you use.Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|