-
Mark it first, and you will post it immediately when you write it.
I got a mysql first.。。。
select name, date, group concat(string separator''As totalstring from test group by name, date.
It's fairly simple, let's take a look at oracle's, since oracle doesn't have an official group string connection function, I can only write it myself.
First of all, its own functions.
create or replace function group str( str con1 in varchar2,str con2 in varchar2 )- categorical field.
return varchar2
is group_str varchar2(4000) default null;--Post-connection string.
str varchar2(20) default null;--Connectors between strings.
beginfor x in ( select name, date, string from test where test.)Name = str con1 and testdate = str con2 ) loop
str_list := group_str ||str ||to_char(x.strings);
str := '';--There are no connectors between the --strings.
end loop;
return group_str;
end;How to use:
select name, date, group str(string separator''As totalstring from test group by name, date.
Note that this function is only useful for this test table, the disadvantage is that the first table has to write a function...
OK, it's over.
-
It seems that through the "mail merge" function, the specific operation was forgotten.
-
You can connect it with a + sign in the middle.
-
SQL 2005 should work with for XML.
Multiple lines are converted to one line.
-
This can be achieved by writing stored procedures.
Table 1: T1Name Date Value: 3 January 1 aaa
Zhang San January 1 BBB
Zhang San January 1 CCC
Zhang San January 2 a
Zhang San January 2 b
Li Si January 2 x
Lee Si January 2 y
The second Table 2, name, date, valuepro:
Cursor 1 (select name, date from t1 group by name, date).
Cursor 2 (select value from t1 a where cursor and cursor.
Splice the value of cursor 2, and then, get the name and date of cursor 1. Insert Table II.
That's pretty much it.
-
Based on your second query, row-to-column, if the type is dynamic, it is recommended to encapsulate the stored procedure. Set a query on the outer layer and use max(case when then .end ) as 'Listing'..
This kind of alchemist can be realized.
-
Is the problem solved? I also want to achieve the effect of your third step, I don't know how you do it?
-
Link the user table in one of the access databases to the user table in the other access database, and you can implement your function.
Steps: 1. Suppose there are two access databases, and 2. there is a user table.
3. Select the last item of the new table and connect to the user table.
4. In this way, the data synchronization of the user table of the two access data calendar chain lead libraries can be realized.
Above, I hope it will help you.
-
This seems to have to use cursors and temporary tables, and short SQL statements can't be done by gods.
-
First, add a temporary field (with duplicate flags) in Table 2, and then set the duplicate flag to the duplicate field, so that the duplicate flag field can be used as a condition when merging.
-
You can write a PHP program to solve it.,Just follow what you said.。 But to know the data structure, it's best to have a test environment to guarantee that there are no errors.
-
group by group join query to deduplicate.
-
After exporting the tables of each Bihe database, import them one by one into the data of Xinnian Huichen.
Or use insert into new (column1, column2, ..)select column1, column2 ..from old_;
-
Take this job.
Hi me q I 38967098
There are a lot of details that are not clear here.
Use a conversion function, :from unixtime, to convert the timestamp to a common time format. >>>More
If you are using SQL Server, open Enterprise Manager.
1.Create a database. >>>More
Try to capture the return value.
SQL Server syntax:
create procedure proc_name@para1 int) >>>More
At least the basic things must be mastered, such as: the linear structure of the database, the storage method, the way to call Hezheng, and the operation of the table in the database (to use statements to erect the bench to achieve). >>>More