我搜索了很多例子,我得到了很好的例子:
但是没有得到最有希望的解决方案,所以我可以在我的mysql函数中使用来查询行的十万行.
这个是一个非常新的概念,但是没有像@start_date = '2013-08-03' , @end_date = '2013-08-21'
预期的答案那样起作用:13,它只给出12,
SELECT 5 * (DATEDIFF(@end_date, @start_date) DIV 7) + MID('0123444401233334012222340111123400012345001234550', 7 * WEEKDAY(@start_date) + WEEKDAY(@end_date) + 1, 1);
Run Code Online (Sandbox Code Playgroud)
所以我试着自己做 -
Concept :
Input : 1. period_from_date - from date
2. period_to_date - to date
3. days_to_exclude - mapping : S M T W TH F Sat => 2^0 + 2^6
(sat and sun to exclude) ^ ^ ^ ^ ^ ^ ^
0 1 2 3 4 …
Run Code Online (Sandbox Code Playgroud) 我想从html onclick事件中将参数传递给onclick jquery函数.
PHP中的html语句呈现
$name = "abcd";
for ($i=0;$<10;$i++){
$text .= '<tr>
<td>'.$i.'</td>
<td><div id="name">'.$name.'/div>
<a class="href" onclick="callJSFunc($i,\''.$name.'\')" ></a>
</td>
</tr>';
}
Run Code Online (Sandbox Code Playgroud)
JavaScript的..
function callJSFunc(i , name){
alert(i+" "+name);
}
Run Code Online (Sandbox Code Playgroud)
我想把它转换成某种......
$(".href").click(function(i,name,event){
alert(i+" "+name);
});
Run Code Online (Sandbox Code Playgroud) 我想加入表数据而不增加no.的行.
并且这两个表在没有主键的情况下连接,只有在两者中共有的列的帮助下,没有其他列可以用于结果,因为没有其他列完全相关.
表格1
id1(pk) name country clm_id
1 abc 3 23
2 abc 4 23
Run Code Online (Sandbox Code Playgroud)
表2
id2(pk) city state clm_id
1 cdv 5 23
2 sdc 5 23
Run Code Online (Sandbox Code Playgroud)
我想通过clm_id加入这些表,但它给了我4行, 我想要
id1 name country clm_id id2 city state
1 abc 3 23 1 cdv 5
2 abc 4 23 2 sdc 5
Run Code Online (Sandbox Code Playgroud)
但我得到了
id1 name country clm_id id2 city state
1 abc 3 23 1 cdv 5
1 abc 3 23 2 sdc 5
2 abc 4 23 …
Run Code Online (Sandbox Code Playgroud)