我有以下代码:
$result = mysql_query( "SELECT DISTINCT number, customerNumber FROM countries, customers WHERE admin.username= '$usernameDB'" );
admin.username
是当前在系统中登录的用户的名称,number
和customerNumber
是此admin.username
已创建和修改的数字,因此我根据{{1}}值生成表格。我需要的是获得某个$result
已创建/修改的所有number
和customerNumber
,但这取决于此特定admin.name
的第一个字母。我正在考虑尝试像
admin.username
但这不起作用。 任何帮助将不胜感激。
答案 0 :(得分:0)
像这样使用:
SELECT author FROM lyrics WHERE author LIKE' B%';
答案 1 :(得分:0)
您的查询不明确,表之间没有正确的关系
...试
Option Compare Database
Option Explicit
Sub QueryExportMod()
Dim db As DAO.Database
Set db = CurrentDb
Dim xlApp As Excel.Application
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Set xlApp = New Excel.Application
Set wb = xlApp.Workbooks.Open(CurrentProject.Path & "\ExportExcelTest.xlsm")
Set ws = wb.Worksheets("Sheet1")
ws.ListObjects.Add(xlSrcRange, Range("$A$20:$B$21"), , xlYes).Name = "tb2"
xlApp.Visible = True
xlApp.Run "callAG"
Set xlApp = Nothing
Set wb = Nothing
Set ws = Nothing
End Sub