標籤:http://www.cnblogs.com/glory-jzx/archive/2012/07/19/2599215.htmlhttp://sunxiaqw.blog.163.com/blog/static/990654382013430105130443/ 這篇文章寫的很清楚了,請參考,多謝原作者。 select loan_user_id from sp_invest_project p where exists(
標籤:BEGIN SET @userId = (SELECT user_id FROM t_shoporder WHERE id = orderId); /*修改訂單狀態,改成已支付*/ UPDATE t_shoporder SET `status` = 1,update_time = NOW() WHERE id = orderId; /*查詢使用者是否已經學習改課程*/ SET @count = (SELECT count(1) FROM
標籤:BEGIN DECLARE smark INT; DECLARE orderId INT; /*查詢課程是否存在,如果不存在就不執行訂單操作了*/ SET @count = (SELECT count(1) FROM t_course WHERE id = courseId); IF @count = 0 THEN SELECT "noexist"; ELSE /*查詢某個課程是否已經報名,如果已經報名了就不需要在報名了*
標籤: //查看當前商品庫存 function checkProductStock($product_id){ global $wpdb; $sql="SELECT post_id,max(if((meta_key = ‘_stock_status‘),meta_value,‘‘)) AS stock_status,//此方法的作用max(if((meta_key = ‘_manage_stock‘),meta_value,‘‘)) AS
標籤: 特殊資料類型資料表條件約束表串連索引觸發器安全性DB設計 alter table student modify id int primary key;主銉不可重複修改 alter table student modify id int auto_increment; 特殊資料類型EnumSetTextBlobTIMESTAMP 預設值create table users ( id integer, name varchar(20),