-
Next day retention? add_months(to_date(to_char(sysdate,'yyyymmdd'),'yyyymmdd'),-2)
The display takes the system time, and then converts it into the form of yyyymmdd, and then uses add months to add or subtract, -2 represents the first two days, that is, 20150729, 2 means the last two days 20150802, and then let the value of the column in where be equal to this.
If it's the 7th, just let the column you query in such a 7-day line.
-
You can query according to the date, use getdate() to get the current time, use dateadd(day,1,getdate()) to locate the next day's date, and then query, refer to the following code:
select * from tab_1 where date = dateadd(day,1,getdate())
select * from tab_1 where getdate() date < dateadd(day,7,getdate())
-
PL SQL Developper, you can save the SQL query results by using the Export button
-
Depending on what development language you use, there are many methods on the Internet, save to excel, xml, txt and other documents.
-
Did you create the rusults table first? select * from table2 into table1 requires table1 to not exist. At this point, the system automatically creates and inserts values.
-
According to your description, the table structure of results is the same as that of customer, then there is nothing wrong with your statement.
insert into results
select * from customer where customer number in (select customer number from order list) order by customer number;
The reason why you don't have data in the new table is because you don't have a commit.
-
Insert into results select * from customer where customer number in(select customer number from order list) order by customer number.
-
select ( select count(distinct userid ) from Dengtong noisy world limb record table where login time = today ) select count(1) from registry where registration time = yesterday ) as household retention rate buried.
-
into select statement.
The form of the statement is insert into table2(field1,field2,..select value1,value2,..from table1
The destination table table2 must exist, and since the destination table 2 already exists, we can insert constants in addition to the fields in the source table table1.
into from statement.
The statement is in the form of: select vale1, value2 into table2 from table1
The target table table2 does not exist, because table table 2 is automatically created when inserted, and the data of the specified fields in table 1 is copied to table 2.
-
All that's saved is the query itself.
The query result is the result after you need to execute this SQL statement, and the query condition is only the content after the where statement in your SQL statement.
-
The contents of this query are saved! It's the ** inside the query analyzer! It can be opened with a notepad.
-
If you want to store SQL statements in a table in the database, this is a big overhead and is not recommended.
You can save SQL statements as: The file at the end of SQL is saved on the hard disk, and you can call the file directly when you want to execute it. This way you don't have to put too much pressure on the database.
select
from[Table name]. >>>More
F get domain contrast is a formatting function (should be written by yourself), the first parameter (arg prod spec id) according to the second parameter (120) formatting and return the result to the v bill code, according to the function naming method, the above ** should be the standard format for getting the date.
With a view or an index.
create index >>>More
For example, the name of your table is a
select a.Name, aGrades as Language, BGrades as Mathematics. >>>More
Generally refers to indexing. You don't have to.