Select from multiple tables without a join?

后端 未结 8 1159
轻奢々
轻奢々 2020-12-05 01:53

What is the easiest way to select data from two tables and rather than join them, have them appear as separate rows. Both tables have similar or matching fields and I want t

8条回答
  •  佛祖请我去吃肉
    2020-12-05 02:21

    In this case we are assuming that we have two tables: SMPPMsgLogand SMSService with common column serviceid:

    SELECT sp.SMS,ss.CMD 
    FROM vas.SMPPMsgLog AS sp,vas.SMSService AS ss 
    WHERE sp.serviceid=5431 
    AND ss.ServiceID = 5431 
    AND Receiver ="232700000" 
    AND date(TimeStamp) <='2013-08-07' 
    AND date(TimeStamp) >='2013-08-06' \G;
    

提交回复
热议问题