Code: Select all
"SELECT Clients.*, History.ClientName FROM Clients, History WHERE History.ClientID = Clients.ClientID"
ThankYou
Code: Select all
"SELECT Clients.*, History.ClientName FROM Clients, History WHERE History.ClientID = Clients.ClientID"
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Database example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
UseSQLiteDatabase()
Procedure CheckDatabaseUpdate(Database, Query$)
Result = DatabaseUpdate(Database, Query$)
If Result = 0
Debug DatabaseError()
EndIf
ProcedureReturn Result
EndProcedure
DatabaseFile$ = GetTemporaryDirectory()+"/Database.sqlite"
If CreateFile(0, DatabaseFile$)
CloseFile(0)
If OpenDatabase(0, DatabaseFile$, "", "")
CheckDatabaseUpdate(0, "CREATE TABLE food (name CHAR(50), weight INT)")
CheckDatabaseUpdate(0, "INSERT INTO food (name, weight) VALUES ('apple', '10')")
CheckDatabaseUpdate(0, "INSERT INTO food (name, weight) VALUES ('pear', '5')")
CheckDatabaseUpdate(0, "INSERT INTO food (name, weight) VALUES ('banana', '20')")
If DatabaseQuery(0, "SELECT * FROM food WHERE weight > 7")
While NextDatabaseRow(0)
Debug GetDatabaseString(0, 0)
Wend
FinishDatabaseQuery(0)
EndIf
CloseDatabase(0)
Else
Debug "Can't open database !"
EndIf
Else
Debug "Can't create the database file !"
EndIf
Code: Select all
If DatabaseQuery(0, "SELECT * FROM food WHERE weight > 7")
While NextDatabaseRow(0)
Debug GetDatabaseString(0, 0)
Wend
FinishDatabaseQuery(0)
EndIf
Code: Select all
SQL$ = "SELECT Clients.*, History.ClientName FROM Clients, History WHERE History.ClientID = Clients.ClientID"
If OpenDatabase(0, DatabaseFile$, "", "")
If DatabaseQuery(0, SQL$)
While NextDatabaseRow(0)
Debug GetDatabaseString(0, 0)
Wend
FinishDatabaseQuery(0)
EndIf
CloseDatabase(0)
Else
Debug "Can't open database !"
EndIf
Yes absolutely. When the help manual talks about 'database columns' it is typically referring to 'recordset' columns (as opposed to table columns) and of course a recordset may represent a single table or a bunch of records resulting from multiple joins across multiple tables etc.ClueLess wrote:@ srod
You mean the column in the GetDatabaseString ( #Database , Column) means the column in the result and not in the table?????
If so, your posts make sense
Thanks