0
我需要使用查詢來選擇一些數據,其中需要顯示授權數據,其餘數據應該用XXXXXXXX
標記,但我需要從表中獲取所有數據單個查詢。SQL查詢根據條件選擇不同的選擇列表
select empid, orgid, fname, lastname, mname, depid, date
from employee
where orgid in (100,200,300,400,500)
輸出應該是這樣的:
10 100 3 "dfdf" "dfsdfd" "sdfsdfd" "sdfsdfd" "10/10/2010"
20 200 4 "dfdf" "dfsdfd" "sdfsdfd" "sdfsdfd" "10/10/2010"
30 300 5 "dfdf" "dfsdfd" "sdfsdfd" "sdfsdfd" "10/10/2010"
40 400 6 "dfdf" "dfsdfd" "sdfsdfd" "sdfsdfd" "10/10/2010"
50 500 7 "dfdf" "dfsdfd" "sdfsdfd" "sdfsdfd" "10/10/2010"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
XX XXXX X "xxxx" "XXXXXX" "XXXXXXX" "XXXXXX" "XXXXXXXXXX"
MySQL或SQL服務器? – Madhivanan
我在你想要的輸出中計數8列,但你的'SELECT'列表只有7列。 –
幫我理解你在這裏試圖做什麼......所以,你想要返回表*的全部內容,但是用'X'來檢查所有不符合你的'WHERE'要求的東西? – Siyual