Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Table 1
Region | City |
West Th | West Thane |
West Mu | West Mumbai |
East Mu | East Mumbai |
South Mu | South Mumbai |
North Th | North Thane |
North Na | North Nashik |
West Na | West Nashik |
East Na | East Nashik |
South Na | South Nashik |
West Na | West Nagpur |
North Na | North Nagpur |
West Pu | West Pune |
East Pu | East Pune |
South Pu | South Pune |
North Mu | North Mumbai |
South Th | South Thane |
North Pu | North Pune |
East Th | East Thane |
West Ra | West Raigad |
North Ra | North Raigad |
North Ah | North Ahmedabad |
West Ah | West Ahmedabad |
Table 2
Name | Mobile | Status | Region |
Amit Prabhu | 9820261173 | Maharashtra | West Th |
Narayan Nihalani | 9324764624 | Maharashtra | West Mu |
Rameez Shaikh | 9930038445 | Maharashtra | East Mu |
Deepak Soni | 8080106009 | Maharashtra | South Mu |
Muzammil Ansari | 9892964447 | Maharashtra | North Th |
Sandeep Patwa | 9222337250 | Maharashtra | North Na |
Warish Hashmi | 9699446027 | Maharashtra | West Na |
Sarfaraz Ansari | 8080220160 | Maharashtra | East Na |
Somnath Birajdar | 9220588835 | Maharashtra | South Na |
Saish Wagle | 8983915333 | Maharashtra | West Na |
Shaeque Khan | 9987700440 | Maharashtra | North Na |
Paresh Kawa | 9930583258 | Maharashtra | West Pu |
Abdul Kayyum Shaikh | 9920290489 | Maharashtra | East Pu |
Sarfaraz Mirza | 9930884114 | Maharashtra | South Pu |
Abdul Aamir Shaikh | 9545778881 | Maharashtra | North Mu |
Jiten Gala | 7666555055 | Maharashtra | South Th |
Salman Imran Kadiwal | 9819852367 | Maharashtra | North Pu |
Rupesh Pawar | 9220360005 | Maharashtra | East Th |
Chirag Tailor | 7738240256 | Maharashtra | West Ra |
Mohmad Idris Akbar Shaikh | 9222999710 | Maharashtra | North Ra |
Ankesh | 8898101766 | Maharashtra | North Ah |
Sagar Bhangare | 9260435066 | Maharashtra | West Ah |
How can we join this tables using joins and then sort according to the Region.
eg.
Name | Mobile | Status | Region | City |
Amit Prabhu | 9820261173 | Maharashtra | West Th | West Thane |
Narayan Nihalani | 9324764624 | Maharashtra | West Mu | West Mumbai |
Rameez Shaikh | 9930038445 | Maharashtra | East Mu | East Mumbai |
Deepak Soni | 8080106009 | Maharashtra | South Mu | South Mumbai |
and so on
**** The City name should be sorted such that All west thane should be together, all West Mumbai should be together...
Is there a reason for you to sort this in the script? You have to use this in the Aggr() function or something to make the load order sort work?
Hi,
Please find the sample code below. You cannot join and order at the same time as it will not give desired output and Order by will be applied on resident load only.
TabA:
load * inline [
Region, City
West Th, West Thane
West Mu, West Mumbai
East Mu, East Mumbai
South Mu, South Mumbai
North Th, North Thane
North Na, North Nashik];
right join(TabA)
TabB:
load * inline [
Name, Mobile, Status, Region
Amit Prabhu, 9820261173, Maharashtra, West Th
Narayan Nihalani, 9324764624, Maharashtra, West Mu
Rameez Shaikh, 9930038445, Maharashtra, East Mu
Deepak Soni, 8080106009, Maharashtra, South Mu
Muzammil Ansari, 9892964447, Maharashtra, North Th
Sandeep Patwa, 9222337250, Maharashtra, North Na
Warish Hashmi, 9699446027, Maharashtra, West Na
];
NoConcatenate
TABA_2:
load * Resident TabA order by Region;
drop table TabA;