What is the use of order by in asp

Updated on Game 2024-03-31
19 answers
  1. Anonymous users2024-02-07

    order by is the keyword of sorting, followed by the field, for example: select * from table name order by [ id]asp in the database object to execute this statement to obtain the sorted result set data reference.

  2. Anonymous users2024-02-06

    Sort. Like sorting by latest date or something.

    select * from news order by [newsdate] desc

    This T-SQL refers to the query of the news in descending order.

    select * from news order by [newsdate] asc

    This T-SQL refers to querying the news in ascending order (generally the result is queried out in this way by )

  3. Anonymous users2024-02-05

    Sort out the content of your SQL query in order by the field you order by.

    DESC descending ASC ascending

  4. Anonymous users2024-02-04

    order by

    In order to. Sort by method.

    This is the statement of SQL.

    Like what. order by name.

    It's sorted by name.

  5. Anonymous users2024-02-03

    1. What kind of database is the landlord?,Like the back is generally matched with %.,How do you use *?,I'm very skeptical that your statement can be executed.。

    2. The content of your order by is as follows:

    fld like '*Guangzhou*') -fld like '*Recruitment*') -fld like '*Exam Papers*')

    But a "fld like."'*Guangzhou*'"The expression result is 0 or 1, because your conditional query is and, in fact, the result of these three like expressions is 1, then it is actually order by -3, and there is no sorting effect.

  6. Anonymous users2024-02-02

    Sort order by what you want.

  7. Anonymous users2024-02-01

    Clearly wrong**.

    First of all, order by should not be followed by an expression like like .

    Second, even if the value after order by is -3 as it says upstairs, then order by -3 desc means sorted in reverse order of column -3. This -3 column is non-existent, syntax error.

  8. Anonymous users2024-01-31

    Is the questioner's question a bit problematic? First of all, what is the data type of your pi itype, what is the data type of ssearchcondition, and what is the data type of pip sort. Different data types are written differently. There are additions and there are additions like this'"&&'There are also those that are added like this"&&" .

  9. Anonymous users2024-01-30

    ssql = "select * from view_productpic where pip_bbigflag=1 and pi_itype=" & pi_itype & ssearchcondition&" order by pip_sort"I don't know about the first floor, please don't talk nonsense.

  10. Anonymous users2024-01-29

    You need to add".""After that, I will add your sentence, and after yours will add it."" ”。

  11. Anonymous users2024-01-28

    is the maximum select top(5) *from (table name) order by id asc

    In order, the old ones are on top.

  12. Anonymous users2024-01-27

    dateadd('m',e_date,e_cycle)

    Changed to dateadd('m',e_cycle,e_date)

    In other words, the last two parameters should be reversed.

  13. Anonymous users2024-01-26

    In most cases, an ASP connection database retrieves data and an order by is added to the SQL statement.

    dim id,name,param,rs,sql,sid,order

    sid=request("sid")'Parameters submitted by the front-end form page.

    id=request("id")

    order=request("order")

    param=" and id>"&id&" and 1=1 "'Various conditions.

    if order="1" then'Customize.

    param=param&" order by adddate desc "

    else if order="2" then

    param=param&" order by id asc"

    end if

    sql="select * from a where "¶m&""

    sql'If there is an error debugging, write down the SQL statement to see if there is an error.

    set rs="")

    sql,conn,1,1

    if and then

    nothing"

    elsedo while not

    loopend if

    set rs=nothing

    Parameters are written in ajax.

    Unfortunately, the one above can also respond to AJAX requests for front-end sorting interactions. The backend is simple, the rest is a matter of front-end JS.

  14. Anonymous users2024-01-25

    If you can't read it, it may be an error. It's hard to say. You can send it up and have a look.

    There's nothing wrong with your SQL statement here. You have to see what went wrong to fix it.

  15. Anonymous users2024-01-24

    SQL is no problem.

    It should be something else, like a space server problem.

  16. Anonymous users2024-01-23

    The statement is no problem, please check the server disk permission settings, ** directory has writable permissions.

  17. Anonymous users2024-01-22

    Your grammar is wrong.

    strsql = "select * from tbproducts where 1=1 order by flag desc"

    if request("typeid")<>"" then'If this condition is true.

    end if

    Then the SQL statement should look like this.

    select * from tbproducts where 1=1 order by flag desc and type=value.

    order by must be placed at the end of the statement.

    It should be changed to this.

    strsql="select * from tbproducts where 1=1"

    if request("typeid")<>

    strsql=strsql&" order by flag desc"

    Concatenated strings are best used"&", do not use"+"

    If your typeid is an integer, don't put single quotes.

  18. Anonymous users2024-01-21

    Change to: strsql ="select * from tbproducts where 1=1 "

    if request("typeid")<>"" thenend if

    strsql=strsql+" order by flag desc"

    Try to make an error, it should be that the value of the typeid is not passed, check the parent page with parameters.

  19. Anonymous users2024-01-20

    That's going to be a problem.

    strsql = "select * from tbproducts where 1=1 "

    if request("typeid")<>"" thenend if

    strsql=strsql+" order by flag desc"

    That's it.

Related questions
8 answers2024-03-31

The REPLACE in asp means: [count] replace; DOS External Commands: Supersede or Update Files!

10 answers2024-03-31

"msgbox ""The account is already in use"""

You can't use single quotation marks, but double quotation marks. >>>More

4 answers2024-03-31

dim rs,sql,filename,fs,myfile,objspreadsheet,x

set fs = "") >>>More

5 answers2024-03-31

select * from users where useraccount=" + "'" + username + "'" + "and userpwd=" + "'" + strmd5 + "'" >>>More

6 answers2024-03-31

The common way to calculate the number of cards is: A 4 points, K 3 points, Q 2 points, J 1 points, the sum of 40 points, the general opening of the hand of the hand is not less than 16 points, the greater the number of points, the better, now you can understand why +4, +3, +1.