SQL Statement Lite version

Source: Internet
Author: User
Tags joins script tag

Select US. Qq,us.tel,us.username,sc. Englishscore,sc. Mathscore
From userinfor us right join score SC on US. Userid=sc. Userid

Select US. Qq,us.tel,us.username,sc. Englishscore,sc. Mathscore
From userinfor us to join score SC on us. Userid=sc. Userid

Select Us.userid,us. Qq,us.tel,us.username,sc. Englishscore,sc. Mathscore
From Userinfor US Inner joins score SC on us. Userid=sc. Userid

Select Uss.userid,uss.username,uss. Mathscore,pss.father,pss.mother
From (select Us.userid,us. Qq,us.tel,us.username,sc. Englishscore,sc. Mathscore
From Userinfor US Inner joins score SC on us. Userid=sc. Userid
) USS Left joins parents PSS on USS. Userid=pss.userid


SELECT * FROM Userinfor
Select Top 3 * FROM
(select Row_number () over (order to UserID) as rownumber,* from Userinfor) A
where rownumber>6
Select Userid,username,age,
Case
When age<=25 and then ' pupil '
When age>25 and age<30 then ' middle school students '
Else ' College students '
End as Usergrade from Userinfor

Select Userid,username,age,
Case
When age=25 and then ' pupil '
When age>25 and age<30 then ' middle school students '
Else ' College students '
End as Usergrade from Userinfor

SELECT * FROM Userinfor

Select Top 3 * FROM
(select Row_number () over (order to UserID) as rownumber,* from Userinfor)
A
where rownumber>0
Select Top (
Select Row_number () over (order by UserID) as Rownumber,*from userinfor
) A
where rownumber>3
SELECT * FROM Userinfor

Select Userid,username,age,
Case
When age<=25 and then ' pupil '
When the age of between and then ' middle school students '
Else ' College students '
End as Usergrade from Userinfor
Select *from Score

Select Ui.userid, Ui.username,ui.qq,ui.tel,sc. Englishscore,sc.mathscore from Userinfor UI left Join
Score SC on Ui.userid=sc.userid
SELECT * FROM parents
Select Uss.userid,uss.tel,uss.mathscore,ps.father,ps.mother from
(select Ui.userid, Ui.username,ui.qq,ui.tel,sc. Englishscore,sc.mathscore from Userinfor UI left Join
Score SC on Ui.userid=sc.userid) USS to join parents PS on Uss.userid=ps.userid

SELECT * FROM Userinfor
Select Top 3 * FROM (
Select Row_number () over (order by UserID) as Rownumber,*from userinfor
) A where rownumber>0


Enter the JS scope when you see the script tag and call function
Enter the scope for 1111111111111111111111111111111. JS Pre-parsing open up a space there is no Var, there are no method parameters, will be var and method parameters, declared variables are assigned to undefined,
222222222222222222222222222222.JS progressive execution is to find out if there is no expression ++=====-----Some words, the value of the variables inside the JS scope to modify.


What is restful, I answer is get post put delete request specification, each keyword has a specific meaning, follow the style of the front and rear separation development. Q. What progress has been made in JavaScript's call apply Bind,promise compared to previous technology? Answer it is mainly to solve the problem of depth callback, because in the asynchronous operation you have to wait to complete the next operation, will form a depth callback. And Promise can return Promise through then resolution, the arrow function of this always points to the current object, this, because I am writing C # was born, so this is also very familiar with me. Ajax cross-domain access needs to pay attention to what problems, a, generally in the development of the time, will be directly accesscontrolalloworigin*, the official release requires some configuration. JSONP cross-domain needs and background convention Jsonpcallback, for the options complex request needs a more than a judgment return 200, you in gulp main use what, Sass Babel transcoding JS combined with the automatic completion of the CSS. Merge, Compress. Talk about the difference between MVC and MVVM, this question I most confused, because has been used, Java background MVC pattern, the front-end framework MVVM such as Vue, such as {} is an instance object, it only has a __proto__, and the function object will have prototype, for example, The function person () {} Person.prototype is the prototype object of the new person (). person.__proto__ is equal to Function.prototype, answer: function.prototype.__proto__ is equal to Object.prototype,. And then I started asking Vue, how do you use Vue in the project you wrote, I said I just think of it as a handy tool for manipulating the DOM, no application webpack, have you ever used Vuex, well, you've written some small test experiences, centralized management by speaking State, Avoids the confusion of managing state between sibling components.

Paging:
Next page
function Next () {
var roleName = $ ("input[name= ' RoleName ')"). Val ();
var pagesize = $ ("input[name= ' pagesize ')"). Val ();
var PageIndex = parseint ($ ("#currpage"). Text ()) + 1;
var lastpagenum = $ ("#lastpage"). Text ();
if (parseint (PageIndex) > parseint (lastpagenum));
{
PageIndex = Lastpagenum;
}
$.ajax ({
Type: "Get",
URL: ".. /role/roledata ",
DataType: "JSON",
Data: {rolename:rolename, pagesize:pagesize, Pageindex:pageindex},
Success:suc
});
}
Previous page
function BackPage () {
var roleName = $ ("input[name= ' RoleName ')"). Val ();
var pagesize = $ ("input[name= ' pagesize ')"). Val ();
var PageIndex = parseint ($ ("#currpage"). Text ())-1;
if (parseint (PageIndex) < 1);
{
PageIndex = 1;
}
$.ajax ({
Type: "Get",
URL: ".. /role/roledata ",
DataType: "JSON",
Data: {rolename:rolename, pagesize:pagesize, Pageindex:pageindex},
Success:suc
});
}
Last
function Weipage () {
var roleName = $ ("input[name= ' RoleName ')"). Val ();
var pagesize = $ ("input[name= ' pagesize ')"). Val ();
var PageIndex = $ ("#lastpage"). Text ();
$.ajax ({
Type: "Get",
URL: ".. /role/roledata ",
DataType: "JSON",
Data: {rolename:rolename, pagesize:pagesize, Pageindex:pageindex},
Success:suc
});
}

Take the data method, we just need to get the current page (pageindex) and (pagesize) each page display how much, plus your query criteria, together to the data access layer that method can get the corresponding data to do return
131-Curtain Wai Yue Ming-Men 2018/1/9 Tuesday 10:43:59
Here is the front-end list page code
$ (function () {
Serach ();
});
Inquire
function Serach () {
var roleName = $ ("input[name= ' RoleName ')"). Val ();
var pagesize = $ ("input[name= ' pagesize ')"). Val ();
var pageIndex = 1;
$.ajax ({
Type: "Get",
URL: ".. /role/roledata ",
DataType: "JSON",
Data: {rolename:rolename, pagesize:pagesize, Pageindex:pageindex},
Success:suc
});
};
function Suc (JData) {
if (jdata.data) {
$ (". mt-20 table Tbody"). empty ();
var strtable = "";
var intcount = JData.Data.length;
var strstatus = "";
var strurl = "";
for (var i = 0; i < intcount; i++) {
Strtable + = "<tr class= ' text-c ' style= ' height:18px ' ><td align= ' center ' ><input type=\" checkbox\ "value= \ "" + jdata.data[i]. role_id + "\" name=\ "Chk\"/></td> ";
Strtable + = "<td align= ' center ' >" + jdata.data[i]. role_id + "</td>";
Strtable + = "<td align= ' center ' >" + jdata.data[i]. Deptname + "</td>";
Strtable + = "<td align= ' center ' >" + jdata.data[i]. Role_name + "</td>";
Strtable + = "<td class= ' text-l ' >" + jdata.data[i]. CREATOR + "</td>";
Strtable + = "<td>" + gettime (jdata.data[i). Creat_tim) + "</td>";
Strtable + = "<td class= ' text-l ' >" + jdata.data[i]. Reviser + "</td>";
Strtable + = "&LT;TD >" + gettime (jdata.data[i). Revis_tim) + "</td>";
strstatus = Jdata.data[i]. STATUS;
Strtable + = "<td class= ' td-status ' ><span class= ' label label-success radius ' >" + GetStatus (strstatus) + "< /span></td> ";
Strtable + = "<td class= ' f-14 td-manage ' >";
Strtable + = Getbuttonstart (strstatus, Jdata.data[i]. ROLE_ID);
Strtable + = Getbuttonstop (strstatus, Jdata.data[i]. ROLE_ID);
Strtable + = "<a title= ' edit ' href= ' javascript:; ' onclick=\ ' Member_edit (this, '" + jdata.data[i]. role_id + "') \" Style= ' text-decoration:none;margin:0 0 0 5px ' ><i class= ' hui-iconfont ' >& #xe6df;</i></a> ";
Strtable + = "<a title= ' delete ' href= ' javascript:; ' onclick=\ ' Member_del (this, '" + jdata.data[i]. role_id + "') \" Style= ' text-decoration:none;margin:0 0 0 5px ' ><i class= ' hui-iconfont ' >& #xe6e2;</i></a> ";
Strtable + = "<a title= ' Select Product ' href= ' javascript:; ' onclick=\ ' Getgoodsbyroleid (this, '" + jdata.data[i]. role_id + "') \" Style= ' text-decoration:none;margin:0 0 0 5px ' ><i class= ' hui-iconfont ' >& #xe6f5;</i></a></td></tr> ";
}
$ ("#RegionTable tbody"). Append (strtable);
$ (". Totalpage"). HTML (jdata.datatotal);//total number of rows
$ (". Total"). HTML (jdata.totalpage);//General page
$ ("#currpage"). Text (jdata.pageindex);//Current page
}
};
function GetStatus (status) {
if (parseint (status) = = 1)
Return ' enabled ';
Else
return ' disabled ';
}
function Getbuttonstart (status, Levelid) {
if (parseint (status)! = 1) {
Return "<a style= ' Text-decoration:none ' onclick=\" Member_start (This, ' "+ Levelid +" ') \ "href= ' javascript:; ' title= ' Enable ' > <i class= ' hui-iconfont ' >& #xe6e1;</i></a> ";
}
else {
Return "<a class= ' adisabled ' style= ' text-decoration:none ' onclick=\" Member_start (This, ' "+ Levelid +" ') \ "Href= ' javascript:; ' title= ' Enable ' > <i class= ' hui-iconfont ' >& #xe6e1;</i></a> ';
}
}
function getbuttonstop (status, Levelid) {
if (parseint (status) = = 1) {
Return "<a style= ' text-decoration:none;margin:0 5px 0 5px; ' onclick=\ ' member_stop (this, ' "+ Levelid +" ') \ "href= ' javascript:; ' title= ' disables ' ><i class= ' Hui-iconfont ' >& #xe631;</i></a> ";
}
else {
Return "<a class= ' adisabled ' style= ' text-decoration:none;margin:0 5px 0 5px; ' onclick=\ ' member_stop (this, ' "+ Levelid +" ') \ "href= ' javascript:; ' title= ' disables ' ><i class= ' Hui-iconfont ' >& #xe631;</i></a> ";
}
}

The following is the controller that returns the AJAX request data, like this can be written again. ASHX (in a generic handler)
Public ActionResult Roledata ()
{
int intpagesize = Int. Parse (request.querystring["pageSize"]! = null? Convert.ToString (request.querystring["PageSize"]): "");
int intpageindex = Int. Parse (request.querystring["PageIndex"]! = null? Convert.ToString (request.querystring["PageIndex"]): "");
String strrolename = request.querystring["RoleName"]! = null? Convert.ToString (request.querystring["RoleName"]): "";
Expression<func<dms_role_inf, bool>> lambdawhere = null;
Lambdawhere = lambdawhere.and<dms_role_inf> (x = 1 = = 1);
int inttotalcount = 0;
if (!string. IsNullOrEmpty (strRoleName))
{
Lambdawhere = lambdawhere.and<dms_role_inf> (x = X.role_name. Contains (strRoleName));
}
List<dms_role_inf> lstlevel = _ibssession. Createdms_role_inf. Getmodels<int> (Lambdawhere, Intpageindex, intpagesize, out inttotalcount, x = x.role_id, True). ToList ();
int inttotalpage = Gettotalpage (Inttotalcount, intpagesize);
list<models.dbmodelsext.role> lstrole = new list<models.dbmodelsext.role> ();
Lstrole = Common.dbmodelsext.modelstmodelsext<dms_role_inf, models.dbmodelsext.role>. Convert (Lstlevel);
Lstrole.foreach (x = X.deptname = Getdeptname (x.depardment_id));
Ajaxmsgmodel Ajaxmsgmodel = new Ajaxmsgmodel ()
{
Statu = ajaxstatuenum.success,
MSG = "OK",
Data = Lstrole,
Backurl = "",
Datatotal = Inttotalcount,
PageIndex = Intpageindex,
PageSize = Intpagesize,
Totalpage = Inttotalpage
};
Return Json (Ajaxmsgmodel, jsonrequestbehavior.allowget);
}

<summary>
Paging query table Data
</summary>
<typeparam name= "Tkeytype" > Data type used when sorting <peparam>
<param name= "Excwhere" > Querying lambda expression tree </param>
<param name= "PageIndex" > page index </param>
<param name= "pageSize" > page record number </param>
<param name= "TotalCount" > Total Records </param>
<param name= "Excorderby" > Sort lambda expression tree </param>
<param name= "Isasc" > Ascending or Descending, true ascending, False descending </param>
<returns></returns>
Public iqueryable<t> getmodels<tkeytype> (expression<func<t, bool>> excWhere, int pageIndex, int pageSize, out int totalcount, expression<func<t, tkeytype>> Excorderby, bool ISASC)
{
iqueryable<t> tmp = _dbcontext.set<t> (). Where<t> (Excwhere);
TotalCount = tmp. Count<t> ();
if (ISASC)
{
return TMP. (Excorderby). Skip ((pageIndex-1) * pageSize). Take (pageSize);
}
Else
{
return TMP. OrderByDescending (Excorderby). Skip ((pageIndex-1) * pageSize). Take (pageSize);
}
}//this C # data Access Layer EF framework for server-side paging
public class Ajaxmsgmodel
{
public string MSG {get; set;}
Public Ajaxstatuenum Statu {get; set;}
public string Backurl {get; set;}
Public object Data {get; set;}
public int Datatotal {get; set;}
public int PageIndex {get; set;}
public int PageSize {get; set;}
public int Totalpage {get; set;}
}

SQL Statement Lite version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.