How to Combine two column in one table using SQL statement ?
Could you write the simple SQL statement from 'Combine two column in one table '?
I try to use 'Union' which combine two column in two table . thx
You can use the concatention operator (+):
column1 + column2 AS myColumn
TerriTerri MortonEngagement Manager, NeudesicHow to ask a question
If the columns are numeric then "+" will sum the column values.
If you do not desire this, you should use str() function
Check the below statement,
select ltrim(str(column1)) + ltrim(str(column2)) from mytable
http://www.eral...SQL query to one column od database into two columns
Hi,I have a empskill Table which has 3 Columns (1) EmpID (2) SkillTypeID and (3) CourseID.Now SkillTypeID column has data 1 or 2 .......in here 1 means Primary Skill and 2 means Secondary Skill. CourseID will reflect the ID's of subjects like c#,SQL,etc I need a Query which will count the number of primary skilled and number of secondary skilled persons based on subject and will display as followsCOURSE ID SKILL TYPE 21 222 &n...SQL: mutiple rows one column to multiple columns one row
In InfoMaker SQL can you take a table with multiple
rows for the same key and take a column from the
rows and create mutiple columns with one
report line with the key(no duplicate keys) on a report? For example
(key) (book title)
The report I need would look like this
Key title1 title2 title 3
123 misery titanic roots
456 war 1984 giant
Thanks in advance.
...How to combine two SQL Datasource and put it in GridView?
I'm trying to combine two datasources together. The reason I have to combine them is because, one database is used by a software that I can't manipulate, the other database is exact one I created for an internal custom software. They both have different connectionstrings. I have the VB code below.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)Dim PCConnectionString As String = "Data Source=Source1;Initial Catalog=Center;Persist Security Info=True"Dim PCcon As SqlConnection = New SqlConnection(PCConnectionString)Dim TCConnectio...how to combine two sql commands in one DeleteCommand
Is there any way to have the SqlDataSource DeleteCommand execute two sql commands. That is, something like:
DeleteCommand="DELETE FROM [HRMFile] WHERE [id_file] = @original_id_file;DELETE FROM [HRMFileLap] WHERE [id_file] = @original_id_file">
If not, is there a simple example of how to connect a stored procedure to the datasource. (like a tutorial or article?)
Thanks, and Happy New Year!!!
Peter Kellnerhttp://73rdstreet.com and blogging athttp://PeterKellner.netMVP, ASP.NET
The Sql Statement in your example, should do what you want, but I would suggest you use ...combine two tables with different columns in sql sever
I have a requirement like..
One table has 12 columns for all month with different year.
Lets say i need values from sep-2008 to Mar-2009.
I need to select the values from sep-2008 to dec-2008 as a single table and jan-2009 to Mar-2009 values as a single table.
Now i need to combine these two table as a single table.
Please help how to combine two tables with different columns.
The question is unclear (put samples of exact data structure, test data and desired output). I think you need to look at UNPIVOT operator in SQL Server 2005. Look at the H...Combining Two Fields from a SQL DB into One Dropdown box
What I am trying to do is to concatenate 2 fields from a table into 1 dropdown box. It comes up with an error when it tries to do a Databind.
lblDept.Text = ("ID") & " - " & ("Description")
ddlDept.DataTextField = lblDept.Text
ddlDept.DataSource = GetDept()
What am I missing?
You may modify the SELECT statement as:
SELECT ID + ' - ' + Description AS FullDetail FROM ...
Then, set the FullDetail as the DataTextField.
Thanks for info....it works wonde...can anyone show me how to combine these two SQL queries into one
i have a fairly big SQL query that is used to display data into a datagrid. Each query grabs data from two seperate databases. Is there anyway to combine these queries into one so all the data appears in 1 datagrid and not 2.
here is the 1st query:
SQL = "SELECT sum(case when month(pb_report_shippers.shipper_date_time) = 1 then pb_report_shippers_lots.quantity else 0 end) as Jan ,sum(case when month(pb_report_shippers.shipper_date_time) = 2 then pb_report_shippers_lots.quantity else 0 end) as Feb ,sum(case when month(pb_report_shippers.shipper_date_time) = 3 then pb_rep...Combine Two Different Columns into one column
I have twotables(Employee and Borrower). In Employee table have EMPID and Borrower table have BorrowerID. I want to comebine these two columns into one column as EMPID in Employee table. Can any one help?
what is realtion between to tables ?
Thanks for reply.
Acutally Employee table EMPID, NAME Columns. in this Employee table had 12000 rows. Borrower table has BorrowerID,BType etc.. .Here Employee ID and BorrowerID both are same. This table has 16000 rows. Now my what i want to do is Come EMPID and BorrowerID and ...How To Combine 2 SQL Query Results Into One In Order To Bind to a Gridview Datasource?
In code behind (.cs), I have to perform two seperate sql queries.
For the simplicity, First I need to select the CustomerName from TableA. then another query to select CustomerPhone from TableB.
Note that there IS NO join between these two tables.
How can I combine these two resullts so that I can bind it to a single gridview datasource?
Any suggestion for a simple solution.. ?
Do your tables have only one column? Iterate through tableB and copy all rows to tableA...
It could also be done at...Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %>
<%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%>
<body style="margin:0 0 0 0;padding:0 0 0 0">
...how to operate two table of two DSN in one SQL statment?
I want to operate two table of two DSN in one SQL statment,
please help me.
I don't think it is possible to answer this question unless you let us know
which DBMS you're using ;-)
Geert 'Darling' Van Damme
strong wrote in message ...
>I want to operate two table of two DSN in one SQL statment,
>please help me.
You won't be able to do this directly, each DSN would require a separate
ODBC connection and a separate transaction object in PowerBuilder.
Different DBMS's do, however, have features that will let you reach
across homo...Display multiple columns in Gridview from One Column of SQL table
Hi I have a table in sql with 2 columns and I want to display that in multiple columns in Gridview.
3 &...Combine WATCOM SQL and TRANSACT SQL Syntax
The WATCOM and TRANSACT SQL syntax descriptions should appear together
in the Help. There are features of both which are helpful, and it is
less than productive to have to read two Help topics to read about one
For example, the syntax for SELECT is presented in two places, and
they aren't connected in the "See Also" list.
Also, the Help - Index facility should always jump to the syntax
description as the first choice when a keyword like SELECT is chosen,
not some general tutorial or other topic.
Hmmm. We'll have to see about this one. Here is...