-
Refer to :
select
as xh, as xm ,case when ' ' then else end as zt ,case when ' ' then else end as timech
from student a
inner join change b on = and > '20110120' and = 'In school'
Because it's at home, there's no way to debug it, you can try it, and ask if you have any questions!
-
Brother, what's so troublesome, see the question clearly, the cursor at every turn, want to stun the dead Mi select top 5
from emptable
where 2>1
order by salary desc
-
If the execution frequency is very high, it may occupy all the database links too quickly, causing other database access operations to not be executed normally, if this phenomenon occurs, it will lead to the phenomenon of suspended animation in the whole system in a short period of time, which is absolutely unacceptable.
-
select * from [table name] where time between 2012-12-01 00:00:00 and 2012-12-07 23:59:59
Because time is generally stored in the database in a fixed format such as the date time type, you can use between...and..Function.
You can also use ">"."<"for example, datetime>2012-12-01 00:00:00 and datetime<2012-12-07 23:59:59
-
If it is to find the value range of the field, then it can be queried twice in ascending and descending order, which is implemented as a result output.
sql:select * from(select top 1 * from tblname order by id desc)
union (select top 1 * from tblname order by id asc);
Explanation: The first record is queried in descending order, then the first record is queried in ascending order, and then the result is output as two pieces of data.
-
Take id as an example, take the first entry in descending order and ascending order as the first and last entry of lz, select top 1 * from tblname order by id desc
unionselect top 1 * from tblname order by id
-
Follow this and change it yourself.
select convert(varchar(12) ,date ,112 ),sum(chengji) from table where date between '2013-3-10 23:59:59' and '2013-3-12 23:
and name='Xiao Ming' and age='15' group by convert(varchar(12) ,date ,112 )
-
Is there a mistake in your data?
Why is the low-order code of 003 02? Shouldn't it be 01?
In your results, the first four columns of fields are easy to understand? You can explain the last three fields, I built a table according to my idea and wrote it.
create table article number information table.
Part number varchar(3), name varchar(1), lower order code varchar(2)).
insert into the article number information sheet values ('001','a','00')
insert into the article number information sheet values ('002','b','01')
insert into the article number information sheet values ('003','c','01')
insert into the article number information sheet values ('004','d','02')
insert into the article number information sheet values ('005','e','02')
Run the Select Inull(aPart number,''Main part number, Inull (A.).Name,''Name, BItem No., BName,
from Part Number Information Sheet a join Part Number Information Sheet B on APart number,'0'+b.Low-order results.
-
It's clear that there's something wrong with your data description:
How can a 1 c order code be 02?
2 In the part number list, there is a field that is clearly missing: Parent part number 3 After correcting the above error, you will know what to do.
-
If the sequence used in this table is not used by other tables, you can try the sql statement:
select * from tablename where id=sequence name. nowval (that's the current value of the sequence, I can't remember if it's nowval for a long time), or just use nexval-1
You try it first.
-
select
from table.
where the column that uses the sequence = the serial number. currval
-
Since there is a sequence . Then take max
-
If 6% to 9% is a deterministic record, then it's easy
select * from table where percentage field between 6% and 9%.
If you are not sure about the 6 9%, then you don't need to ask again, what is not certain in itself, the query is still uncertain
select
from[Table name]. >>>More
With the acceleration of the popularity of automobiles, our daily travel has become a lot more convenient, the number of traffic accidents has also increased, the traffic accident rate is ** every year, no matter what kind of road conditions, riders must slow down, otherwise it is very easy to endanger the life safety of drivers and others. >>>More
First, there are 4 main channels for inquiring about automobile accident records, namely: >>>More
Bank counter inquiry: Bring your ID card.
and postal passbook to the local postal business outlets, use the passbook to make up for boarding to check the transaction status and the balance in the card, or you can let the staff operate at the counter to check and print the transaction records and balance. >>>More
You can check the records from a year ago.
Step 2: After entering the payment page, scroll down and select Didi Chuxing. >>>More