magento ÔÚMagentoÖÐʹÓÃ×Ô¼ºÐ´µÄSQLÓï¾ä
MagentoµÄModels
ºÍCollection
ºÜÇ¿´ó£¬Ê¹ÓÃËüÃÇ¿ÉÒԺܷ½±ãµÄ²éѯºÍ²Ù×÷Êý¾Ý¿â¡£µ«ÊÇÓÐЩ³¡ºÏ£¬ÒòÎªÒ»Ð©ÌØÊâÐèÇó»ò¶ÔMagentoµÄÁ˽ⲻ¹»É¿ÉÄÜ»áÐèÒª×Ô¼ºÊÖдSQLÓï¾äÀ´²éѯºÍ²Ù×÷Êý¾Ý¿â¡£ÒÔÏ·ֱðÊǶÁдÊý¾Ý¿âµÄ´úÂë¡£
// For Read
// fetch read database connection that is used in Mage_Core module
$read= Mage::getSingleton('core/resource')->getConnection('core_read');
$value=$read->query("SE...");
$row = $value->fetch();
print_r($row); // As Array
// For Write
// fetch write database connection that is used in Mage_Core module
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
// now $write is an instance of Zend_Db_Adapter_Abstract
$write->query("insert into tablename values ('aaa','bbb','ccc')");
Ïà¹ØÎĵµ£º
select * from ((select bill.id billId,bach.riskRate risk,bach.assureRate assure from AcptBillInfo bill,AcptBach bach where bill.acptBatchId=bach.id and bill.rgctId=? )abach left outer join AcptSignMoney sig on abach.billId = sig.billId) ......
SQL Server£º´æ´¢Í¼ÏñºÍBLOBÎļþ(Ò»)
×÷ÕߣºØýÃû ÎÄÕÂÀ´Ô´£ºOnegreen.Net ä¯ÀÀ´ÎÊý£º2559 ¸üÐÂʱ¼ä£º2008-5-25 23:16:09
¡¡¡¡Ê²Ã´ÊÇBLOB
¡¡¡¡Ê×ÏÈ£¬ÎÒÃÇÀ´±È½ÏÁ½ÖÖÎļþÀàÐÍASCIIºÍ¶þ½øÖÆ¡£´æ´¢ÔÚSQL ServerÖеĴ󲿷ÖÊý¾ÝÖµ¶¼ÊÇÓÉASCII(ÃÀ¹úÐÅÏ¢½»»»±ê×¼´úÂë)×Ö·û×é³É¡£¼òµ¥ËµÀ´£¬ASCII×Ö·û¾ÍÊÇÄܹ»ÔÚ¼ ......
ÎÒÔÚ½«ExcelµÄÊý¾Ýµ¼Èëµ½SQLµÄʱºòÀÏÊdzöÏÖÏÂÃæµÄ´íÎó£º
ÅäÖÃÑ¡Ïî 'show advanced options' ÒÑ´Ó 1 ¸ü¸ÄΪ 1¡£ÇëÔËÐÐ RECONFIGURE Óï¾ä½øÐа²×°¡£
ÅäÖÃÑ¡Ïî 'Ad Hoc Distributed Queries' ÒÑ´Ó 1 ¸ü¸ÄΪ 1¡£ÇëÔËÐÐ RECONFIGURE Óï¾ä½øÐа²×°¡£
ÏûÏ¢ 7399£¬¼¶±ð 16£¬×´Ì¬ 1£¬µÚ 1 ÐÐ
Á´½Ó·þÎñÆ÷ "(null)" µÄ OLE DB ·ÃÎÊ ......
select a.ClassName,a.CourseName,sum(²»¼°¸ñ) as ²»¼°¸ñ,sum(²î) as ²î,sum(ÖеÈ) as ÖеÈ,sum(ºÃ) as ºÃ ,sum(²»¼°¸ñ)+sum(²î)+sum(ÖеÈ)+sum(ºÃ) as °à¼¶×ÜÈËÊý from (select StudentID,ClassName,CourseName,1 as ²»¼°¸ñ,0 as ²î,0 as ÖеÈ,0 as ºÃ from StudentScore where ScoreRemark='fail' union all
select Stu ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Str
{
public partial class Form1 : F ......