的某些屬性值我有一些數據如下表:SQl的排序基於連接表
Collector:
dcid name hostid userid
123 test host1 234
567 hello host2 345
CollectorConfiguration:
ID propertyname propertyvalue collector_id(foreign key)
id1 c_source local 123
id2 c_createdby admin 123
id3 c_pattern JBoss 123
id4 c_source remote 567
id4 c_createdby admin 567
id4 c_pattern Apache 567
現在我需要從收集表中的所有記錄在CollectorConfiguration排序的列值「c_pattern」表。
我試圖使用內部連接寫查詢,但我無法得到所需的結果。請幫忙。
注意:返回的結果僅包含收集器表的列,即它應該像收集器中的select *那樣工作,但對c_pattern屬性值具有sortinn。
Desired output(with ascending order on c_pattern):
567 hello host2 345
123 test host1 234
你應該提供你的願望OUTP UT。同時告訴我們你有什麼嘗試。 –
'propety name'是什麼意思c_pattern「'?您在不是該列的值的列上進行排序,除非您的意思是按該值過濾。 –
@JuanCarlosOropeza我編輯了相應的問題。讓我知道你是否需要任何其他信息。 – geekprogrammer