mercredi 8 juillet 2015

duplicate columns when using join

I am trying to join two tables: trainSearchStream and SearchInfo based on a common column: SearchID.

SELECT *
FROM   trainSearchStream
       INNER JOIN SearchInfo
               ON trainSearchStream.SearchID = SearchInfo.SearchID
LIMIT  3; 

The problem is that the result has two columns for SearchID. How can I display only one column for SearchID?

These are the columns of trainSearchStream:

SearchID,AdID,Position,ObjectType,HistCTR,IsClick

and these are columns for SearchInfo:

 SearchDate,IPID,UserID,IsUserLoggedOn,SearchQuery,LocationID,CategoryID,SearchParams

My other question is that how can I save the result of my select statement in a new table?

Aucun commentaire:

Enregistrer un commentaire